Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.h

    ref5c185 r0da65d5  
    3232typedef enum
    3333{
    34         JFLAG_STREAM_STARTED = 1,       /* Set when we detected the beginning of the stream
     34        JFLAG_STREAM_STARTED = 1,       /* Set when we detected the beginning of the stream
    3535                                           and want to do auth. */
    36         JFLAG_AUTHENTICATED = 2,        /* Set when we're successfully authenticatd. */
    37         JFLAG_STREAM_RESTART = 4,       /* Set when we want to restart the stream (after
     36        JFLAG_AUTHENTICATED = 2,        /* Set when we're successfully authenticatd. */
     37        JFLAG_STREAM_RESTART = 4,       /* Set when we want to restart the stream (after
    3838                                           SASL or TLS). */
    39         JFLAG_WAIT_SESSION = 8,         /* Set if we sent a <session> tag and need a reply
     39        JFLAG_WAIT_SESSION = 8,         /* Set if we sent a <session> tag and need a reply
    4040                                           before we continue. */
    41         JFLAG_WAIT_BIND = 16,           /* ... for <bind> tag. */
    42         JFLAG_WANT_TYPING = 32,         /* Set if we ever sent a typing notification, this
     41        JFLAG_WAIT_BIND = 16,           /* ... for <bind> tag. */
     42        JFLAG_WANT_TYPING = 32,         /* Set if we ever sent a typing notification, this
    4343                                           activates all XEP-85 related code. */
    44         JFLAG_XMLCONSOLE = 64,          /* If the user added an xmlconsole buddy. */
    4544} jabber_flags_t;
    4645
     
    5150        JBFLAG_DOES_XEP85 = 2,          /* Set this when the resource seems to support
    5251                                           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. */
    5752} jabber_buddy_flags_t;
     53
     54#define JABBER_PORT_DEFAULT "5222"
     55#define JABBER_PORT_MIN 5220
     56#define JABBER_PORT_MAX 5229
    5857
    5958struct jabber_data
     
    102101        char *resource;
    103102       
    104         char *ext_jid; /* The JID to use in BitlBee. The real JID if possible, */
    105                        /* otherwise something similar to the conference JID. */
    106        
    107103        int priority;
    108104        struct jabber_away_state *away_state;
     
    114110        struct jabber_buddy *next;
    115111};
    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
    130112
    131113/* Prefixes to use for packet IDs (mainly for IQ packets ATM). Usually the
     
    150132#define XMLNS_TIME         "jabber:iq:time"                     /* XEP-0090 */
    151133#define XMLNS_VCARD        "vcard-temp"                         /* XEP-0054 */
    152 #define XMLNS_DELAY        "jabber:x:delay"                     /* XEP-0091 */
    153134#define XMLNS_CHATSTATES   "http://jabber.org/protocol/chatstates"  /* 0085 */
    154135#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 */
    157136
    158137/* iq.c */
     
    185164const struct jabber_away_state *jabber_away_state_by_name( char *name );
    186165void jabber_buddy_ask( struct im_connection *ic, char *handle );
    187 char *jabber_normalize( const char *orig );
     166char *jabber_normalize( char *orig );
    188167
    189168typedef enum
    190169{
    191170        GET_BUDDY_CREAT = 1,    /* Try to create it, if necessary. */
    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. */
     171        GET_BUDDY_EXACT = 2,    /* Get an exact message (only makes sense with bare JIDs). */
    194172} get_buddy_flags_t;
    195 
    196 struct jabber_error
    197 {
    198         char *code, *text, *type;
    199 };
    200173
    201174struct jabber_buddy *jabber_buddy_add( struct im_connection *ic, char *full_jid );
    202175struct 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 );
    204176int jabber_buddy_remove( struct im_connection *ic, char *full_jid );
    205177int 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 );
    210178
    211179extern const struct jabber_away_state jabber_away_state_list[];
     
    225193gboolean sasl_supported( struct im_connection *ic );
    226194
    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 
    236195#endif
Note: See TracChangeset for help on using the changeset viewer.