Changeset eee3a5a


Ignore:
Timestamp:
2015-02-21T06:14:06Z (9 years ago)
Author:
dequis <dx@…>
Children:
59c1fe7
Parents:
75ad761
git-author:
dequis <dx@…> (29-07-14 15:51:51)
git-committer:
dequis <dx@…> (21-02-15 06:14:06)
Message:

Preset topic in groupchat if it's in irc_channel already

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r75ad761 reee3a5a  
    573573        ic->data = c;
    574574
    575         topic = g_strdup_printf(
    576                 "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!",
    577                 c->title);
    578         irc_channel_set_topic(ic, topic, irc->root);
    579         g_free(topic);
     575        if (ic->topic == NULL) {
     576                /* New channel with no preset topic - make up a generic one */
     577                topic = g_strdup_printf(
     578                        "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!",
     579                        c->title);
     580                irc_channel_set_topic(ic, topic, irc->root);
     581        } else {
     582                /* Preset topic from the channel we picked */
     583                topic = g_strdup(ic->topic);
     584        }
     585
     586        g_free(c->topic);
     587        c->topic = topic;         /* Let groupchat borrow this pointer */
    580588
    581589        return TRUE;
Note: See TracChangeset for help on using the changeset viewer.