diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-07-01 17:29:21 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-07-01 17:29:21 +0100 |
commit | b9f8b870f7b884747b747be91ce0ac797a7c6e82 (patch) | |
tree | c9878ed7826e424306c2e8956f636ac0db1d9513 /protocols/jabber/message.c | |
parent | 2758cfed0abcb529975af34fdb4d2603febbf1a3 (diff) |
Better handling of private messages via groupchats.
Diffstat (limited to 'protocols/jabber/message.c')
-rw-r--r-- | protocols/jabber/message.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/protocols/jabber/message.c b/protocols/jabber/message.c index 198fc3b9..52ee3a53 100644 --- a/protocols/jabber/message.c +++ b/protocols/jabber/message.c @@ -52,7 +52,10 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data ) if( ( s = strchr( from, '/' ) ) ) { if( bud ) + { bud->last_act = time( NULL ); + from = bud->ext_jid ? : bud->bare_jid; + } else *s = 0; /* We need to generate a bare JID now. */ } @@ -80,7 +83,7 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data ) fullmsg = g_string_append( fullmsg, body->text ); if( fullmsg->len > 0 ) - imcb_buddy_msg( ic, bud ? bud->bare_jid : from, fullmsg->str, + imcb_buddy_msg( ic, from, fullmsg->str, 0, jabber_get_timestamp( node ) ); g_string_free( fullmsg, TRUE ); @@ -89,18 +92,18 @@ xt_status jabber_pkt_message( struct xt_node *node, gpointer data ) if( xt_find_node( node->children, "composing" ) ) { bud->flags |= JBFLAG_DOES_XEP85; - imcb_buddy_typing( ic, bud ? bud->bare_jid : from, OPT_TYPING ); + imcb_buddy_typing( ic, from, OPT_TYPING ); } /* No need to send a "stopped typing" signal when there's a message. */ else if( xt_find_node( node->children, "active" ) && ( body == NULL ) ) { bud->flags |= JBFLAG_DOES_XEP85; - imcb_buddy_typing( ic, bud ? bud->bare_jid : from, 0 ); + imcb_buddy_typing( ic, from, 0 ); } else if( xt_find_node( node->children, "paused" ) ) { bud->flags |= JBFLAG_DOES_XEP85; - imcb_buddy_typing( ic, bud ? bud->bare_jid : from, OPT_THINKING ); + imcb_buddy_typing( ic, from, OPT_THINKING ); } if( s ) |