aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/jabber/jabber.h')
-rw-r--r--protocols/jabber/jabber.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h
index 42f57ae1..dd771910 100644
--- a/protocols/jabber/jabber.h
+++ b/protocols/jabber/jabber.h
@@ -49,6 +49,8 @@ typedef enum
sure it gets sent only once. */
JBFLAG_DOES_XEP85 = 2, /* Set this when the resource seems to support
XEP85 (typing notification shite). */
+ JBFLAG_IS_CHATROOM = 4, /* It's convenient to use this JID thingy for
+ groupchat state info too. */
} jabber_buddy_flags_t;
#define JABBER_PORT_DEFAULT "5222"
@@ -100,6 +102,9 @@ struct jabber_buddy
char *full_jid;
char *resource;
+ /* Groupchat-only */
+ char *orig_jid;
+
int priority;
struct jabber_away_state *away_state;
char *away_message;
@@ -110,6 +115,13 @@ struct jabber_buddy
struct jabber_buddy *next;
};
+struct jabber_chat
+{
+ int flags;
+ char *name;
+ struct jabber_buddy *me;
+};
+
/* Prefixes to use for packet IDs (mainly for IQ packets ATM). Usually the
first one should be used, but when storing a packet in the cache, a
"special" kind of ID is assigned to make it easier later to figure out
@@ -133,6 +145,8 @@ struct jabber_buddy
#define XMLNS_VCARD "vcard-temp" /* XEP-0054 */
#define XMLNS_CHATSTATES "http://jabber.org/protocol/chatstates" /* 0085 */
#define XMLNS_DISCOVER "http://jabber.org/protocol/disco#info" /* 0030 */
+#define XMLNS_MUC "http://jabber.org/protocol/muc" /* XEP-0045 */
+#define XMLNS_MUC_USER "http://jabber.org/protocol/muc#user"/* XEP-0045 */
/* iq.c */
xt_status jabber_pkt_iq( struct xt_node *node, gpointer data );
@@ -163,18 +177,20 @@ void jabber_cache_clean( struct im_connection *ic );
const struct jabber_away_state *jabber_away_state_by_code( char *code );
const struct jabber_away_state *jabber_away_state_by_name( char *name );
void jabber_buddy_ask( struct im_connection *ic, char *handle );
-char *jabber_normalize( char *orig );
+char *jabber_normalize( const char *orig );
typedef enum
{
GET_BUDDY_CREAT = 1, /* Try to create it, if necessary. */
- GET_BUDDY_EXACT = 2, /* Get an exact message (only makes sense with bare JIDs). */
+ GET_BUDDY_EXACT = 2, /* Get an exact match (only makes sense with bare JIDs). */
+ GET_BUDDY_FIRST = 4, /* No selection, simply get the first resource for this JID. */
} get_buddy_flags_t;
struct jabber_buddy *jabber_buddy_add( struct im_connection *ic, char *full_jid );
struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags );
int jabber_buddy_remove( struct im_connection *ic, char *full_jid );
int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid );
+struct groupchat *jabber_chat_by_name( struct im_connection *ic, const char *name );
extern const struct jabber_away_state jabber_away_state_list[];
@@ -192,4 +208,10 @@ xt_status sasl_pkt_challenge( struct xt_node *node, gpointer data );
xt_status sasl_pkt_result( struct xt_node *node, gpointer data );
gboolean sasl_supported( struct im_connection *ic );
+/* conference.c */
+struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password );
+int jabber_chat_leave( struct groupchat *c, const char *reason );
+void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
+void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
+
#endif