Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/message.c

    rb9f8b87 r9624fdf  
    3030        char *type = xt_find_attr( node, "type" );
    3131        struct xt_node *body = xt_find_node( node->children, "body" ), *c;
    32         struct jabber_buddy *bud = NULL;
    3332        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 );
    3933       
    4034        if( type && strcmp( type, "error" ) == 0 )
     
    4236                /* Handle type=error packet. */
    4337        }
    44         else if( type && from && strcmp( type, "groupchat" ) == 0 )
     38        else if( type && strcmp( type, "groupchat" ) == 0 )
    4539        {
    46                 jabber_chat_pkt_message( ic, bud, node );
     40                /* TODO! */
    4741        }
    4842        else /* "chat", "normal", "headline", no-type or whatever. Should all be pretty similar. */
    4943        {
     44                struct jabber_buddy *bud = NULL;
    5045                GString *fullmsg = g_string_new( "" );
    5146               
    5247                if( ( s = strchr( from, '/' ) ) )
    5348                {
    54                         if( bud )
    55                         {
     49                        if( ( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) ) )
    5650                                bud->last_act = time( NULL );
    57                                 from = bud->ext_jid ? : bud->bare_jid;
    58                         }
    5951                        else
    6052                                *s = 0; /* We need to generate a bare JID now. */
     
    8476               
    8577                if( fullmsg->len > 0 )
    86                         imcb_buddy_msg( ic, from, fullmsg->str,
    87                                         0, jabber_get_timestamp( node ) );
     78                        imcb_buddy_msg( ic, bud ? bud->bare_jid : from, fullmsg->str, 0, 0 );
    8879               
    8980                g_string_free( fullmsg, TRUE );
     
    9384                {
    9485                        bud->flags |= JBFLAG_DOES_XEP85;
    95                         imcb_buddy_typing( ic, from, OPT_TYPING );
     86                        imcb_buddy_typing( ic, bud ? bud->bare_jid : from, OPT_TYPING );
    9687                }
    9788                /* No need to send a "stopped typing" signal when there's a message. */
     
    9990                {
    10091                        bud->flags |= JBFLAG_DOES_XEP85;
    101                         imcb_buddy_typing( ic, from, 0 );
     92                        imcb_buddy_typing( ic, bud ? bud->bare_jid : from, 0 );
    10293                }
    10394                else if( xt_find_node( node->children, "paused" ) )
    10495                {
    10596                        bud->flags |= JBFLAG_DOES_XEP85;
    106                         imcb_buddy_typing( ic, from, OPT_THINKING );
     97                        imcb_buddy_typing( ic, bud ? bud->bare_jid : from, OPT_THINKING );
    10798                }
    10899               
Note: See TracChangeset for help on using the changeset viewer.