Skip to content

Commit

Permalink
Fixing handling of (Jabber) chatroom topic changes done by the user.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilm0r committed Sep 5, 2010
1 parent 52d63dc commit 41e0c00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion irc_im.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,9 @@ static gboolean bee_irc_channel_chat_topic( irc_channel_t *ic, const char *new )
char *topic = g_strdup( new );
c->ic->acc->prpl->chat_topic( c, topic );
g_free( topic );
return TRUE;
}

/* Whatever happened, the IM module should ack the topic change. */
return FALSE;
}

Expand Down
18 changes: 9 additions & 9 deletions protocols/jabber/conference.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,15 @@ void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud
struct jabber_chat *jc = chat ? chat->data : NULL;
char *s;

if( subject && chat )
{
s = bud ? strchr( bud->ext_jid, '/' ) : NULL;
if( s ) *s = 0;
imcb_chat_topic( chat, bud ? bud->ext_jid : NULL, subject->text_len > 0 ?
subject->text : NULL, jabber_get_timestamp( node ) );
if( s ) *s = '/';
}

if( bud == NULL || ( jc && ~jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me ) )
{
char *nick;
Expand Down Expand Up @@ -365,15 +374,6 @@ void jabber_chat_pkt_message( struct im_connection *ic, struct jabber_buddy *bud
now or just wait for the OS to do it. :-) */
return;
}

if( subject )
{
s = strchr( bud->ext_jid, '/' );
if( s ) *s = 0;
imcb_chat_topic( chat, bud->ext_jid, subject->text_len > 0 ?
subject->text : NULL, jabber_get_timestamp( node ) );
if( s ) *s = '/';
}
if( body && body->text_len > 0 )
{
s = strchr( bud->ext_jid, '/' );
Expand Down

0 comments on commit 41e0c00

Please sign in to comment.