Ignore:
Timestamp:
2007-04-22T23:39:37Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0e7ab64
Parents:
e35d1a1
Message:

You can send messages too now. But it's still very kludgy and doesn't work
with anonymous rooms (ie about 95% of all available Jabber chatrooms?).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    re35d1a1 r43671b9  
    6262}
    6363
    64 int jabber_chat_leave( struct groupchat *c, const char *reason )
     64int jabber_chat_msg( struct groupchat *c, char *message, int flags )
    6565{
    6666        struct im_connection *ic = c->ic;
     
    6868        struct xt_node *node;
    6969       
     70        node = xt_new_node( "body", message, NULL );
     71        node = jabber_make_packet( "message", "groupchat", jc->name, node );
     72       
     73        if( !jabber_write_packet( ic, node ) )
     74        {
     75                xt_free_node( node );
     76                return 0;
     77        }
     78        xt_free_node( node );
     79       
     80        return 1;
     81}
     82
     83int jabber_chat_leave( struct groupchat *c, const char *reason )
     84{
     85        struct im_connection *ic = c->ic;
     86        struct jabber_chat *jc = c->data;
     87        struct xt_node *node;
     88       
    7089        node = xt_new_node( "x", NULL, NULL );
    7190        xt_add_attr( node, "xmlns", XMLNS_MUC );
     
    7897        }
    7998        xt_free_node( node );
    80        
    81         /* Remove all participants from jc->buddies and clean up our data. */
    82         jabber_buddy_remove_bare( ic, jc->name );
    83         g_free( jc->name );
    84         g_free( jc );
    85        
    86         /* And the generic stuff. */
    87         imcb_chat_free( c );
    8899       
    89100        return 1;
     
    188199                s = strchr( bud->orig_jid, '/' );
    189200                if( s ) *s = 0;
    190                 imcb_chat_msg( chat, bud->orig_jid, body->text, 0, 0 );
     201                imcb_chat_msg( chat, bud->orig_jid, body->text, 0, jabber_get_timestamp( node ) );
    191202                if( s ) *s = '/';
    192203        }
Note: See TracChangeset for help on using the changeset viewer.