Changeset eded1f7 for protocols/jabber


Ignore:
Timestamp:
2007-12-18T23:59:35Z (16 years ago)
Author:
kenobi <kenobi@…>
Branches:
master
Children:
2379566
Parents:
dc0ba9c
Message:

Merged in 280..288 from upstream (e.g. PING)

Location:
protocols/jabber
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    rdc0ba9c reded1f7  
    174174       
    175175        return 1;
     176}
     177
     178void jabber_chat_invite( struct groupchat *c, char *who, char *message )
     179{
     180        struct xt_node *node;
     181        struct im_connection *ic = c->ic;
     182        struct jabber_chat *jc = c->data;
     183
     184        node = xt_new_node( "reason", message, NULL );
     185
     186        node = xt_new_node( "invite", NULL, node );
     187        xt_add_attr( node, "to", who );
     188
     189        node = xt_new_node( "x", NULL, node );
     190        xt_add_attr( node, "xmlns", XMLNS_MUC_USER );
     191       
     192        node = jabber_make_packet( "message", NULL, jc->name, node );
     193
     194        jabber_write_packet( ic, node );
     195
     196        xt_free_node( node );
    176197}
    177198
  • protocols/jabber/io.c

    rdc0ba9c reded1f7  
    120120                return TRUE;
    121121        }
    122         else if( st == 0 || ( st < 0 && !sockerr_again() ) )
     122        else if( st == 0 || ( st < 0 && !ssl_sockerr_again( jd->ssl ) ) )
    123123        {
    124124                /* Set fd to -1 to make sure we won't write to it anymore. */
     
    231231                }
    232232        }
    233         else if( st == 0 || ( st < 0 && !sockerr_again() ) )
     233        else if( st == 0 || ( st < 0 && !ssl_sockerr_again( jd->ssl ) ) )
    234234        {
    235235                closesocket( jd->fd );
  • protocols/jabber/iq.c

    rdc0ba9c reded1f7  
    5050        else if( strcmp( type, "get" ) == 0 )
    5151        {
    52                 if( !( c = xt_find_node( node->children, "query" ) ) ||
     52                if( !( ( c = xt_find_node( node->children, "query" ) ) ||
     53                       ( c = xt_find_node( node->children, "ping" ) ) ) || /* O_o WHAT is wrong with just <query/> ????? */
    5354                    !( s = xt_find_attr( c, "xmlns" ) ) )
    5455                {
     
    8182                        xt_add_child( reply, xt_new_node( "tz", buf, NULL ) );
    8283                }
     84                else if( strcmp( s, XMLNS_PING ) == 0 )
     85                {
     86                        xt_free_node( reply );
     87                        reply = jabber_make_packet( "iq", "result", xt_find_attr( node, "from" ), NULL );
     88                        if( ( s = xt_find_attr( node, "id" ) ) )
     89                                xt_add_attr( reply, "id", s );
     90                        pack = 0;
     91                }
    8392                else if( strcmp( s, XMLNS_DISCO_INFO ) == 0 )
    8493                {
     
    8796                                                   XMLNS_CHATSTATES,
    8897                                                   XMLNS_MUC,
     98                                                   XMLNS_PING,
    8999                                                   XMLNS_SI,
    90100                                                   XMLNS_BYTESTREAMS,
  • protocols/jabber/jabber.c

    rdc0ba9c reded1f7  
    423423}
    424424
     425static void jabber_chat_invite_( struct groupchat *c, char *who, char *msg )
     426{
     427        struct jabber_chat *jc = c->data;
     428        gchar *msg_alt = NULL;
     429
     430        if( msg == NULL )
     431                msg_alt = g_strdup_printf( "%s invited you to %s", c->ic->acc->user, jc->name );
     432       
     433        if( c && who )
     434                jabber_chat_invite( c, who, msg ? msg : msg_alt );
     435       
     436        g_free( msg_alt );
     437}
     438
    425439static void jabber_keepalive( struct im_connection *ic )
    426440{
     
    494508        ret->chat_msg = jabber_chat_msg_;
    495509        ret->chat_topic = jabber_chat_topic_;
    496 //      ret->chat_invite = jabber_chat_invite;
     510        ret->chat_invite = jabber_chat_invite_;
    497511        ret->chat_leave = jabber_chat_leave_;
    498512        ret->chat_join = jabber_chat_join_;
  • protocols/jabber/jabber.h

    rdc0ba9c reded1f7  
    189189#define XMLNS_VERSION      "jabber:iq:version"                                   /* XEP-0092 */
    190190#define XMLNS_TIME         "jabber:iq:time"                                      /* XEP-0090 */
     191#define XMLNS_PING         "urn:xmpp:ping"                                       /* XEP-0199 */
    191192#define XMLNS_VCARD        "vcard-temp"                                          /* XEP-0054 */
    192193#define XMLNS_DELAY        "jabber:x:delay"                                      /* XEP-0091 */
     
    293294void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
    294295void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
     296void jabber_chat_invite( struct groupchat *c, char *who, char *message );
    295297
    296298#endif
Note: See TracChangeset for help on using the changeset viewer.