Changes in protocols/jabber/message.c [9624fdf:b9f8b87]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/message.c
r9624fdf rb9f8b87 30 30 char *type = xt_find_attr( node, "type" ); 31 31 struct xt_node *body = xt_find_node( node->children, "body" ), *c; 32 struct jabber_buddy *bud = NULL; 32 33 char *s; 34 35 if( !from ) 36 return XT_HANDLED; /* Consider this packet corrupted. */ 37 38 bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ); 33 39 34 40 if( type && strcmp( type, "error" ) == 0 ) … … 36 42 /* Handle type=error packet. */ 37 43 } 38 else if( type && strcmp( type, "groupchat" ) == 0 )44 else if( type && from && strcmp( type, "groupchat" ) == 0 ) 39 45 { 40 /* TODO! */46 jabber_chat_pkt_message( ic, bud, node ); 41 47 } 42 48 else /* "chat", "normal", "headline", no-type or whatever. Should all be pretty similar. */ 43 49 { 44 struct jabber_buddy *bud = NULL;45 50 GString *fullmsg = g_string_new( "" ); 46 51 47 52 if( ( s = strchr( from, '/' ) ) ) 48 53 { 49 if( ( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) ) ) 54 if( bud ) 55 { 50 56 bud->last_act = time( NULL ); 57 from = bud->ext_jid ? : bud->bare_jid; 58 } 51 59 else 52 60 *s = 0; /* We need to generate a bare JID now. */ … … 76 84 77 85 if( fullmsg->len > 0 ) 78 imcb_buddy_msg( ic, bud ? bud->bare_jid : from, fullmsg->str, 0, 0 ); 86 imcb_buddy_msg( ic, from, fullmsg->str, 87 0, jabber_get_timestamp( node ) ); 79 88 80 89 g_string_free( fullmsg, TRUE ); … … 84 93 { 85 94 bud->flags |= JBFLAG_DOES_XEP85; 86 imcb_buddy_typing( ic, bud ? bud->bare_jid :from, OPT_TYPING );95 imcb_buddy_typing( ic, from, OPT_TYPING ); 87 96 } 88 97 /* No need to send a "stopped typing" signal when there's a message. */ … … 90 99 { 91 100 bud->flags |= JBFLAG_DOES_XEP85; 92 imcb_buddy_typing( ic, bud ? bud->bare_jid :from, 0 );101 imcb_buddy_typing( ic, from, 0 ); 93 102 } 94 103 else if( xt_find_node( node->children, "paused" ) ) 95 104 { 96 105 bud->flags |= JBFLAG_DOES_XEP85; 97 imcb_buddy_typing( ic, bud ? bud->bare_jid :from, OPT_THINKING );106 imcb_buddy_typing( ic, from, OPT_THINKING ); 98 107 } 99 108
Note: See TracChangeset
for help on using the changeset viewer.