Changeset a21a8ac for protocols/jabber/message.c
- Timestamp:
- 2006-10-10T12:05:42Z (18 years ago)
- Branches:
- master
- Children:
- 8eb10c9
- Parents:
- 6a1128d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/message.c
r6a1128d ra21a8ac 29 29 char *from = xt_find_attr( node, "from" ); 30 30 char *type = xt_find_attr( node, "type" ); 31 struct xt_node * msg= xt_find_node( node->children, "body" );31 struct xt_node *body = xt_find_node( node->children, "body" ); 32 32 33 if( !type || !msg)33 if( !type ) 34 34 return XT_HANDLED; /* Grmbl... FIXME */ 35 35 36 36 if( strcmp( type, "chat" ) == 0 ) 37 37 { 38 char *s;38 struct jabber_buddy *bud = NULL; 39 39 40 s = strchr( from, '/' ); 41 if( s ) 42 *s = 0; 40 if( strchr( from, '/' ) == NULL ) 41 { 42 /* It just shouldn't happen. */ 43 hide_login_progress( gc, "Received message packet from bare JID" ); 44 signoff( gc ); 45 return XT_ABORT; 46 } 43 47 44 serv_got_im( gc, from, msg->text, 0, 0, 0 ); 48 bud = jabber_buddy_by_jid( gc, from ); 49 bud->last_act = time( NULL ); 45 50 46 if( s ) 47 *s = '/'; 51 if( body ) /* Could be just a typing notification. */ 52 serv_got_im( gc, bud->handle, body->text, 0, 0, 0 ); 53 54 if( xt_find_node( node->children, "composing" ) ) 55 { 56 bud->flags |= JBFLAG_DOES_JEP85; 57 serv_got_typing( gc, bud->handle, 0, 1 ); 58 } 59 else if( xt_find_node( node->children, "active" ) ) 60 { 61 bud->flags |= JBFLAG_DOES_JEP85; 62 } 48 63 } 49 64 else 50 65 { 51 printf( "Received MSG from %s: %s\n", from, msg ? msg->text : "<null>");66 printf( "Received MSG from %s:\n", from ); 52 67 xt_print( node ); 53 68 }
Note: See TracChangeset
for help on using the changeset viewer.