Changeset c058ff9


Ignore:
Timestamp:
2007-12-09T23:19:35Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
3f2bc2d
Parents:
de03374
Message:

Added /invite support for Jabber chatrooms (and fixed the argument order
to chat_invite).

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    rde03374 rc058ff9  
    207207                if( c->ic && c->ic->acc->prpl->chat_invite )
    208208                {
    209                         c->ic->acc->prpl->chat_invite( c, "", u->handle );
     209                        c->ic->acc->prpl->chat_invite( c, u->handle, NULL );
    210210                        irc_reply( irc, 341, "%s %s", nick, channel );
    211211                        return;
  • protocols/jabber/conference.c

    rde03374 rc058ff9  
    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/jabber.c

    rde03374 rc058ff9  
    427427}
    428428
     429static void jabber_chat_invite_( struct groupchat *c, char *who, char *msg )
     430{
     431        struct jabber_chat *jc = c->data;
     432        gchar *msg_alt = NULL;
     433
     434        if( msg == NULL )
     435                msg_alt = g_strdup_printf( "%s invited you to %s", c->ic->acc->user, jc->name );
     436       
     437        if( c && who )
     438                jabber_chat_invite( c, who, msg ? msg : msg_alt );
     439       
     440        g_free( msg_alt );
     441}
     442
    429443static void jabber_keepalive( struct im_connection *ic )
    430444{
     
    498512        ret->chat_msg = jabber_chat_msg_;
    499513        ret->chat_topic = jabber_chat_topic_;
    500 //      ret->chat_invite = jabber_chat_invite;
     514        ret->chat_invite = jabber_chat_invite_;
    501515        ret->chat_leave = jabber_chat_leave_;
    502516        ret->chat_join = jabber_chat_join_;
  • protocols/jabber/jabber.h

    rde03374 rc058ff9  
    237237void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
    238238void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud, struct xt_node *node );
     239void jabber_chat_invite( struct groupchat *c, char *who, char *message );
    239240
    240241#endif
  • protocols/msn/msn.c

    rde03374 rc058ff9  
    241241}
    242242
    243 static void msn_chat_invite( struct groupchat *c, char *msg, char *who )
     243static void msn_chat_invite( struct groupchat *c, char *who, char *message )
    244244{
    245245        struct msn_switchboard *sb = msn_sb_by_chat( c );
  • protocols/oscar/oscar.c

    rde03374 rc058ff9  
    25092509}
    25102510
    2511 void oscar_chat_invite(struct groupchat *c, char *message, char *who)
     2511void oscar_chat_invite(struct groupchat *c, char *who, char *message)
    25122512{
    25132513        struct im_connection *ic = c->ic;
  • protocols/yahoo/yahoo.c

    rde03374 rc058ff9  
    306306}
    307307
    308 static void byahoo_chat_invite( struct groupchat *c, char *msg, char *who )
     308static void byahoo_chat_invite( struct groupchat *c, char *who, char *msg )
    309309{
    310310        struct byahoo_data *yd = (struct byahoo_data *) c->ic->proto_data;
Note: See TracChangeset for help on using the changeset viewer.