Changeset dd788bb for protocols


Ignore:
Timestamp:
2006-09-21T07:32:39Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4a0614e
Parents:
0b4a0db
Message:

Added enough to not make it crash on login, and it can properly receive
messages now. Just try to figure out why it doesn't get typing
notifications...

Location:
protocols/jabber
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r0b4a0db rdd788bb  
    112112}
    113113
     114static GList *jabber_away_states( struct gaim_connection *gc )
     115{
     116        GList *l = NULL;
     117       
     118        l = g_list_append( l, (void*) "Online" );
     119        l = g_list_append( l, (void*) "Away" );
     120        l = g_list_append( l, (void*) "Extended Away" );
     121        l = g_list_append( l, (void*) "Do Not Disturb" );
     122       
     123        return( l );
     124}
     125
     126static void jabber_set_away( struct gaim_connection *gc, char *state, char *message )
     127{
     128}
     129
    114130void jabber_init()
    115131{
     
    121137        ret->close = jabber_close;
    122138        ret->send_im = jabber_send_im;
    123 //      ret->away_states = jabber_away_states;
     139        ret->away_states = jabber_away_states;
    124140//      ret->get_status_string = jabber_get_status_string;
    125 //      ret->set_away = jabber_set_away;
     141        ret->set_away = jabber_set_away;
    126142//      ret->set_info = jabber_set_info;
    127143//      ret->get_info = jabber_get_info;
  • protocols/jabber/message.c

    r0b4a0db rdd788bb  
    2626xt_status jabber_pkt_message( struct xt_node *node, gpointer data )
    2727{
     28        struct gaim_connection *gc = data;
    2829        char *from = xt_find_attr( node, "from" );
     30        char *type = xt_find_attr( node, "type" );
    2931        struct xt_node *msg = xt_find_node( node->children, "body" );
    3032       
    31         printf( "Received MSG from %s: %s\n", from, msg ? msg->text : "<null>" );
    32         xt_print( node );
     33        if( !type || !msg )
     34                return XT_HANDLED;      /* Grmbl... FIXME */
     35       
     36        if( strcmp( type, "chat" ) == 0 )
     37        {
     38                char *s;
     39               
     40                s = strchr( from, '/' );
     41                if( s )
     42                        *s = 0;
     43               
     44                serv_got_im( gc, from, msg->text, 0, 0, 0 );
     45               
     46                if( s )
     47                        *s = '/';
     48        }
     49        else
     50        {
     51                printf( "Received MSG from %s: %s\n", from, msg ? msg->text : "<null>" );
     52                xt_print( node );
     53        }
    3354       
    3455        return XT_HANDLED;
Note: See TracChangeset for help on using the changeset viewer.