Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.h

    r0da65d5 ref5c185  
    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. */
    4445} jabber_flags_t;
    4546
     
    5051        JBFLAG_DOES_XEP85 = 2,          /* Set this when the resource seems to support
    5152                                           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. */
    5257} jabber_buddy_flags_t;
    53 
    54 #define JABBER_PORT_DEFAULT "5222"
    55 #define JABBER_PORT_MIN 5220
    56 #define JABBER_PORT_MAX 5229
    5758
    5859struct jabber_data
     
    101102        char *resource;
    102103       
     104        char *ext_jid; /* The JID to use in BitlBee. The real JID if possible, */
     105                       /* otherwise something similar to the conference JID. */
     106       
    103107        int priority;
    104108        struct jabber_away_state *away_state;
     
    110114        struct jabber_buddy *next;
    111115};
     116
     117struct 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
    112130
    113131/* Prefixes to use for packet IDs (mainly for IQ packets ATM). Usually the
     
    132150#define XMLNS_TIME         "jabber:iq:time"                     /* XEP-0090 */
    133151#define XMLNS_VCARD        "vcard-temp"                         /* XEP-0054 */
     152#define XMLNS_DELAY        "jabber:x:delay"                     /* XEP-0091 */
    134153#define XMLNS_CHATSTATES   "http://jabber.org/protocol/chatstates"  /* 0085 */
    135154#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 */
    136157
    137158/* iq.c */
     
    164185const struct jabber_away_state *jabber_away_state_by_name( char *name );
    165186void jabber_buddy_ask( struct im_connection *ic, char *handle );
    166 char *jabber_normalize( char *orig );
     187char *jabber_normalize( const char *orig );
    167188
    168189typedef enum
    169190{
    170191        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. */
    172194} get_buddy_flags_t;
     195
     196struct jabber_error
     197{
     198        char *code, *text, *type;
     199};
    173200
    174201struct jabber_buddy *jabber_buddy_add( struct im_connection *ic, char *full_jid );
    175202struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags );
     203struct jabber_buddy *jabber_buddy_by_ext_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags );
    176204int jabber_buddy_remove( struct im_connection *ic, char *full_jid );
    177205int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid );
     206struct groupchat *jabber_chat_by_name( struct im_connection *ic, const char *name );
     207time_t jabber_get_timestamp( struct xt_node *xt );
     208struct jabber_error *jabber_error_parse( struct xt_node *node, char *xmlns );
     209void jabber_error_free( struct jabber_error *err );
    178210
    179211extern const struct jabber_away_state jabber_away_state_list[];
     
    193225gboolean sasl_supported( struct im_connection *ic );
    194226
     227/* conference.c */
     228struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password );
     229void jabber_chat_free( struct groupchat *c );
     230int jabber_chat_msg( struct groupchat *ic, char *message, int flags );
     231int jabber_chat_topic( struct groupchat *c, char *topic );
     232int jabber_chat_leave( struct groupchat *c, const char *reason );
     233void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
     234void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
     235
    195236#endif
Note: See TracChangeset for help on using the changeset viewer.