Changeset 788a1af for protocols/jabber/message.c
- Timestamp:
- 2006-10-15T20:24:01Z (18 years ago)
- Branches:
- master
- Children:
- d74c644
- Parents:
- e617b35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/message.c
re617b35 r788a1af 30 30 char *type = xt_find_attr( node, "type" ); 31 31 struct xt_node *body = xt_find_node( node->children, "body" ); 32 char *s; 32 33 33 34 if( !type ) … … 38 39 struct jabber_buddy *bud = NULL; 39 40 40 if( strchr( from, '/') == NULL )41 if( ( s = strchr( from, '/' ) ) == NULL ) 41 42 { 42 43 /* It just shouldn't happen. */ … … 46 47 } 47 48 48 bud = jabber_buddy_by_jid( gc, from ); 49 bud->last_act = time( NULL ); 49 if( ( bud = jabber_buddy_by_jid( gc, from ) ) ) 50 bud->last_act = time( NULL ); 51 else 52 *s = 0; /* We need to generate a bare JID now. */ 50 53 51 54 if( body ) /* Could be just a typing notification. */ 52 serv_got_im( gc, bud ->handle, body->text, 0, 0, 0 );55 serv_got_im( gc, bud ? bud->handle : from, body->text, 0, 0, 0 ); 53 56 57 /* Handling of incoming typing notifications. */ 54 58 if( xt_find_node( node->children, "composing" ) ) 55 59 { 56 bud->flags |= JBFLAG_DOES_ JEP85;57 serv_got_typing( gc, bud ->handle, 0, 1 );60 bud->flags |= JBFLAG_DOES_XEP85; 61 serv_got_typing( gc, bud ? bud->handle : from, 0, 1 ); 58 62 } 59 else if( xt_find_node( node->children, "active" ) ) 63 /* No need to send a "stopped typing" signal when there's a message. */ 64 else if( xt_find_node( node->children, "active" ) && ( body == NULL ) ) 60 65 { 61 bud->flags |= JBFLAG_DOES_JEP85; 66 bud->flags |= JBFLAG_DOES_XEP85; 67 serv_got_typing( gc, bud ? bud->handle : from, 0, 0 ); 62 68 } 69 else if( xt_find_node( node->children, "paused" ) ) 70 { 71 bud->flags |= JBFLAG_DOES_XEP85; 72 serv_got_typing( gc, bud ? bud->handle : from, 0, 2 ); 73 } 74 75 if( s ) 76 *s = '/'; /* And convert it back to a full JID. */ 63 77 } 64 78 else … … 70 84 return XT_HANDLED; 71 85 } 72
Note: See TracChangeset
for help on using the changeset viewer.