mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Netsplit saved the NICK_REC, but didn't save the dynamically allocated strings
which were part of it. Removed it now and replaced it with saving only op/halfop/voice status. Might have caused some crashes? (hopefully did :) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2234 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3b8622f1aa
commit
020861c698
@ -130,7 +130,7 @@ static void get_server_splits(void *key, NETSPLIT_REC *split,
|
||||
chanrec->nick_count++;
|
||||
if (netsplit_nicks_hide_threshold <= 0 ||
|
||||
chanrec->nick_count <= netsplit_nicks_hide_threshold) {
|
||||
if (splitchan->nick.op)
|
||||
if (splitchan->op)
|
||||
g_string_append_c(chanrec->nicks, '@');
|
||||
g_string_sprintfa(chanrec->nicks, "%s ", split->nick);
|
||||
|
||||
@ -306,8 +306,8 @@ static void split_print(NETSPLIT_REC *rec)
|
||||
|
||||
chan = rec->channels->data;
|
||||
chanstr = chan == NULL ? "" :
|
||||
g_strconcat(chan->nick.op ? "@" :
|
||||
(chan->nick.voice ? "+" : ""), chan->name, NULL);
|
||||
g_strconcat(chan->op ? "@" :
|
||||
(chan->voice ? "+" : ""), chan->name, NULL);
|
||||
|
||||
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, IRCTXT_NETSPLITS_LINE,
|
||||
rec->nick, chanstr, rec->server->server,
|
||||
|
@ -89,7 +89,8 @@ static void event_massjoin(IRC_CHANNEL_REC *channel, GSList *users)
|
||||
static void parse_channel_mode(IRC_CHANNEL_REC *channel, const char *mode,
|
||||
const char *nick, const char *address)
|
||||
{
|
||||
NICK_REC *nickrec, *splitnick;
|
||||
NETSPLIT_CHAN_REC *splitnick;
|
||||
NICK_REC *nickrec;
|
||||
USER_REC *user;
|
||||
GString *str;
|
||||
char *ptr, *curmode, type, *dup, *modestr;
|
||||
|
@ -132,7 +132,9 @@ static NETSPLIT_REC *netsplit_add(IRC_SERVER_REC *server, const char *nick,
|
||||
|
||||
splitchan = g_new0(NETSPLIT_CHAN_REC, 1);
|
||||
splitchan->name = g_strdup(channel->name);
|
||||
memcpy(&splitchan->nick, nickrec, sizeof(NICK_REC));
|
||||
splitchan->op = nickrec->op;
|
||||
splitchan->halfop = nickrec->halfop;
|
||||
splitchan->voice = nickrec->voice;
|
||||
|
||||
rec->channels = g_slist_append(rec->channels, splitchan);
|
||||
}
|
||||
@ -190,8 +192,9 @@ NETSPLIT_REC *netsplit_find(IRC_SERVER_REC *server, const char *nick,
|
||||
g_strcasecmp(rec->address, address) == 0) ? rec : NULL;
|
||||
}
|
||||
|
||||
NICK_REC *netsplit_find_channel(IRC_SERVER_REC *server, const char *nick,
|
||||
const char *address, const char *channel)
|
||||
NETSPLIT_CHAN_REC *netsplit_find_channel(IRC_SERVER_REC *server,
|
||||
const char *nick, const char *address,
|
||||
const char *channel)
|
||||
{
|
||||
NETSPLIT_REC *rec;
|
||||
GSList *tmp;
|
||||
@ -207,7 +210,7 @@ NICK_REC *netsplit_find_channel(IRC_SERVER_REC *server, const char *nick,
|
||||
NETSPLIT_CHAN_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->name, channel) == 0)
|
||||
return &rec->nick;
|
||||
return rec;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
@ -25,14 +25,16 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
NICK_REC nick;
|
||||
unsigned int op:1;
|
||||
unsigned int halfop:1;
|
||||
unsigned int voice:1;
|
||||
} NETSPLIT_CHAN_REC;
|
||||
|
||||
void netsplit_init(void);
|
||||
void netsplit_deinit(void);
|
||||
|
||||
NETSPLIT_REC *netsplit_find(IRC_SERVER_REC *server, const char *nick, const char *address);
|
||||
NICK_REC *netsplit_find_channel(IRC_SERVER_REC *server, const char *nick, const char *address, const char *channel);
|
||||
NETSPLIT_CHAN_REC *netsplit_find_channel(IRC_SERVER_REC *server, const char *nick, const char *address, const char *channel);
|
||||
|
||||
/* check if quit message is a netsplit message */
|
||||
int quitmsg_is_split(const char *msg);
|
||||
|
@ -119,7 +119,9 @@ static void perl_netsplit_server_fill_hash(HV *hv, NETSPLIT_SERVER_REC *rec)
|
||||
static void perl_netsplit_channel_fill_hash(HV *hv, NETSPLIT_CHAN_REC *rec)
|
||||
{
|
||||
hv_store(hv, "name", 4, new_pv(rec->name), 0);
|
||||
hv_store(hv, "nick", 4, iobject_bless(&rec->nick), 0);
|
||||
hv_store(hv, "op", 2, newSViv(rec->op), 0);
|
||||
hv_store(hv, "halfop", 6, newSViv(rec->halfop), 0);
|
||||
hv_store(hv, "voice", 5, newSViv(rec->voice), 0);
|
||||
}
|
||||
|
||||
static void perl_notifylist_fill_hash(HV *hv, NOTIFYLIST_REC *notify)
|
||||
|
@ -9,7 +9,7 @@ netsplit_find(server, nick, address)
|
||||
char *nick
|
||||
char *address
|
||||
|
||||
Irssi::Irc::Nick
|
||||
Irssi::Irc::Netsplitchannel
|
||||
netsplit_find_channel(server, nick, address, channel)
|
||||
Irssi::Irc::Server server
|
||||
char *nick
|
||||
|
Loading…
Reference in New Issue
Block a user