summaryrefslogtreecommitdiff
path: root/modules/database/db_old.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-02-07 13:25:13 -0500
committerAdam <Adam@anope.org>2014-02-07 13:28:07 -0500
commitda6760f606569f4c5e6f9e04c9868960109cd216 (patch)
treefa9d7f5f6c05e80e7372ab7a282c965d619206b4 /modules/database/db_old.cpp
parentad962ad75978dd31c6af180a157722942f87aa11 (diff)
Properly convert suspended nicks and channels in db_old
Diffstat (limited to 'modules/database/db_old.cpp')
-rw-r--r--modules/database/db_old.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp
index 739fcaebe..55926c77b 100644
--- a/modules/database/db_old.cpp
+++ b/modules/database/db_old.cpp
@@ -14,6 +14,7 @@
#include "modules/cs_mode.h"
#include "modules/bs_badwords.h"
#include "modules/os_news.h"
+#include "modules/suspend.h"
#define READ(x) \
if (true) \
@@ -495,7 +496,12 @@ static void LoadNicks()
if (u32 & OLD_NI_HIDE_STATUS)
nc->Extend<bool>("HIDE_STATUS");
if (u32 & OLD_NI_SUSPENDED)
- nc->Extend<bool>("NS_SUSPENDED");
+ {
+ SuspendInfo si;
+ si.what = nc->display;
+ si.when = si.expires = 0;
+ nc->Extend("NS_SUSPENDED", si);
+ }
if (!(u32 & OLD_NI_AUTOOP))
nc->Extend<bool>("AUTOOP");
@@ -764,11 +770,19 @@ static void LoadChannels()
ci->Extend<bool>("SIGNKICK");
if (tmpu32 & OLD_CI_SIGNKICK_LEVEL)
ci->Extend<bool>("SIGNKICK_LEVEL");
- if (tmpu32 & OLD_CI_SUSPENDED)
- ci->Extend<bool>("CS_SUSPENDED");
- READ(read_string(buffer, f));
- READ(read_string(buffer, f));
+ Anope::string forbidby, forbidreason;
+ READ(read_string(forbidby, f));
+ READ(read_string(forbidreason, f));
+ if (tmpu32 & OLD_CI_SUSPENDED)
+ {
+ SuspendInfo si;
+ si.what = ci->name;
+ si.by = forbidby;
+ si.reason = forbidreason;
+ si.when = si.expires = 0;
+ ci->Extend("CS_SUSPENDED", si);
+ }
int16_t tmp16;
READ(read_int16(&tmp16, f));