Changeset 6e9ae72 for irc_im.c


Ignore:
Timestamp:
2011-12-17T13:50:01Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
18c6d36
Parents:
87dddee (diff), 17f057d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Mainline merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r87dddee r6e9ae72  
    197197        irc_t *irc = bee->ui_data;
    198198        irc_user_t *iu = (irc_user_t *) bu->ui_data;
    199         char *dst, *prefix = NULL;
     199        const char *dst;
     200        char *prefix = NULL;
    200201        char *wrapped, *ts = NULL;
    201         irc_channel_t *ic = NULL;
    202202        char *msg = g_strdup( msg_ );
    203203        GSList *l;
     
    206206                ts = irc_format_timestamp( irc, sent_at );
    207207       
    208         /* Too similar to irc_usermsg()... */
    209         if( iu->last_channel )
    210         {
    211                 if( iu->last_channel->flags & IRC_CHANNEL_JOINED )
    212                         ic = iu->last_channel;
    213                 else
    214                         ic = irc_channel_with_user( irc, iu );
    215         }
    216        
    217         if( ic )
    218         {
    219                 dst = ic->name;
     208        dst = irc_user_msgdest( iu );
     209        if( dst != irc->user->nick )
     210        {
     211                /* if not messaging directly, call user by name */
    220212                prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts ? : "" );
    221213        }
    222214        else
    223215        {
    224                 dst = irc->user->nick;
    225216                prefix = ts;
    226                 ts = NULL;
     217                ts = NULL;      /* don't double-free */
    227218        }
    228219       
     
    995986        else if( !acc->prpl->chat_join )
    996987        {
    997                 irc_usermsg( ic->irc, "Named chatrooms not supported on that account." );
     988                irc_rootmsg( ic->irc, "Named chatrooms not supported on that account." );
    998989                return SET_INVALID;
    999990        }
Note: See TracChangeset for help on using the changeset viewer.