diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-20 02:21:02 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-20 02:21:02 +0000 |
commit | 26e09b3b7f9a272339b61ff32967933d765c209a (patch) | |
tree | e6f81a775f9ba20e62914a0e6ce0016e063fb0db | |
parent | e78066213a7fd58ab20271fae145d3f52a7191ce (diff) |
Partial fix for bug #1038, patch from Adam, NS OINFO and CS OINFO now properly set a new oinfo line.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2176 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | src/modules/os_info.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/os_info.c b/src/modules/os_info.c index 3fe5527cc..4e1ef087d 100644 --- a/src/modules/os_info.c +++ b/src/modules/os_info.c @@ -59,6 +59,7 @@ class CommandNSOInfo : public Command { const char *nick = params[1].c_str(); const char *info = params.size() > 2 ? params[2].c_str() : NULL; + char *c; NickAlias *na = NULL; if (!info) @@ -69,6 +70,11 @@ class CommandNSOInfo : public Command if ((na = findnick(nick))) /* ok we've found the user */ { + if (na->nc->GetExt("os_info", c)) + { + delete [] c; + na->nc->Shrink("os_info"); + } /* Add the module data to the user */ na->nc->Extend("os_info", sstrdup(info)); me->NoticeLang(s_NickServ, u, OINFO_ADD_SUCCESS, nick); @@ -173,6 +179,7 @@ class CommandCSOInfo : public Command { const char *chan = params[1].c_str(); const char *info = params.size() > 2 ? params[2].c_str() : NULL; + char *c; ChannelInfo *ci = NULL; if (!info) @@ -183,6 +190,11 @@ class CommandCSOInfo : public Command if ((ci = cs_findchan(chan))) { + if (ci->GetExt("os_info", c)) + { + delete [] c; + ci->Shrink("os_info"); + } /* Add the module data to the channel */ ci->Extend("os_info", sstrdup(info)); me->NoticeLang(s_ChanServ, u, OCINFO_ADD_SUCCESS, chan); |