From 26e09b3b7f9a272339b61ff32967933d765c209a Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Fri, 20 Mar 2009 02:21:02 +0000 Subject: 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 --- src/modules/os_info.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/modules') 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); -- cgit