Changes in protocols/jabber/jabber.h [0da65d5:ef5c185]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.h
r0da65d5 ref5c185 32 32 typedef enum 33 33 { 34 JFLAG_STREAM_STARTED = 1, 34 JFLAG_STREAM_STARTED = 1, /* Set when we detected the beginning of the stream 35 35 and want to do auth. */ 36 JFLAG_AUTHENTICATED = 2, 37 JFLAG_STREAM_RESTART = 4, 36 JFLAG_AUTHENTICATED = 2, /* Set when we're successfully authenticatd. */ 37 JFLAG_STREAM_RESTART = 4, /* Set when we want to restart the stream (after 38 38 SASL or TLS). */ 39 JFLAG_WAIT_SESSION = 8, 39 JFLAG_WAIT_SESSION = 8, /* Set if we sent a <session> tag and need a reply 40 40 before we continue. */ 41 JFLAG_WAIT_BIND = 16, 42 JFLAG_WANT_TYPING = 32, 41 JFLAG_WAIT_BIND = 16, /* ... for <bind> tag. */ 42 JFLAG_WANT_TYPING = 32, /* Set if we ever sent a typing notification, this 43 43 activates all XEP-85 related code. */ 44 JFLAG_XMLCONSOLE = 64, /* If the user added an xmlconsole buddy. */ 44 45 } jabber_flags_t; 45 46 … … 50 51 JBFLAG_DOES_XEP85 = 2, /* Set this when the resource seems to support 51 52 XEP85 (typing notification shite). */ 53 JBFLAG_IS_CHATROOM = 4, /* It's convenient to use this JID thingy for 54 groupchat state info too. */ 55 JBFLAG_IS_ANONYMOUS = 8, /* For anonymous chatrooms, when we don't have 56 have a real JID. */ 52 57 } jabber_buddy_flags_t; 53 54 #define JABBER_PORT_DEFAULT "5222"55 #define JABBER_PORT_MIN 522056 #define JABBER_PORT_MAX 522957 58 58 59 struct jabber_data … … 101 102 char *resource; 102 103 104 char *ext_jid; /* The JID to use in BitlBee. The real JID if possible, */ 105 /* otherwise something similar to the conference JID. */ 106 103 107 int priority; 104 108 struct jabber_away_state *away_state; … … 110 114 struct jabber_buddy *next; 111 115 }; 116 117 struct jabber_chat 118 { 119 int flags; 120 char *name; 121 char *my_full_jid; /* Separate copy because of case sensitivity. */ 122 struct jabber_buddy *me; 123 }; 124 125 #define JABBER_XMLCONSOLE_HANDLE "xmlconsole" 126 127 #define JABBER_PORT_DEFAULT "5222" 128 #define JABBER_PORT_MIN 5220 129 #define JABBER_PORT_MAX 5229 112 130 113 131 /* Prefixes to use for packet IDs (mainly for IQ packets ATM). Usually the … … 132 150 #define XMLNS_TIME "jabber:iq:time" /* XEP-0090 */ 133 151 #define XMLNS_VCARD "vcard-temp" /* XEP-0054 */ 152 #define XMLNS_DELAY "jabber:x:delay" /* XEP-0091 */ 134 153 #define XMLNS_CHATSTATES "http://jabber.org/protocol/chatstates" /* 0085 */ 135 154 #define XMLNS_DISCOVER "http://jabber.org/protocol/disco#info" /* 0030 */ 155 #define XMLNS_MUC "http://jabber.org/protocol/muc" /* XEP-0045 */ 156 #define XMLNS_MUC_USER "http://jabber.org/protocol/muc#user"/* XEP-0045 */ 136 157 137 158 /* iq.c */ … … 164 185 const struct jabber_away_state *jabber_away_state_by_name( char *name ); 165 186 void jabber_buddy_ask( struct im_connection *ic, char *handle ); 166 char *jabber_normalize( c har *orig );187 char *jabber_normalize( const char *orig ); 167 188 168 189 typedef enum 169 190 { 170 191 GET_BUDDY_CREAT = 1, /* Try to create it, if necessary. */ 171 GET_BUDDY_EXACT = 2, /* Get an exact message (only makes sense with bare JIDs). */ 192 GET_BUDDY_EXACT = 2, /* Get an exact match (only makes sense with bare JIDs). */ 193 GET_BUDDY_FIRST = 4, /* No selection, simply get the first resource for this JID. */ 172 194 } get_buddy_flags_t; 195 196 struct jabber_error 197 { 198 char *code, *text, *type; 199 }; 173 200 174 201 struct jabber_buddy *jabber_buddy_add( struct im_connection *ic, char *full_jid ); 175 202 struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags ); 203 struct jabber_buddy *jabber_buddy_by_ext_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags ); 176 204 int jabber_buddy_remove( struct im_connection *ic, char *full_jid ); 177 205 int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid ); 206 struct groupchat *jabber_chat_by_name( struct im_connection *ic, const char *name ); 207 time_t jabber_get_timestamp( struct xt_node *xt ); 208 struct jabber_error *jabber_error_parse( struct xt_node *node, char *xmlns ); 209 void jabber_error_free( struct jabber_error *err ); 178 210 179 211 extern const struct jabber_away_state jabber_away_state_list[]; … … 193 225 gboolean sasl_supported( struct im_connection *ic ); 194 226 227 /* conference.c */ 228 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password ); 229 void jabber_chat_free( struct groupchat *c ); 230 int jabber_chat_msg( struct groupchat *ic, char *message, int flags ); 231 int jabber_chat_topic( struct groupchat *c, char *topic ); 232 int jabber_chat_leave( struct groupchat *c, const char *reason ); 233 void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node ); 234 void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node ); 235 195 236 #endif
Note: See TracChangeset
for help on using the changeset viewer.