1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 22:26:39 +02:00

Initialize ChannelInfo in the Modern C++ way.

This commit is contained in:
Sadie Powell
2025-03-26 11:23:05 +00:00
parent b5213d5a81
commit f3e5ccf353
2 changed files with 6 additions and 14 deletions
+3 -3
View File
@@ -84,11 +84,11 @@ public:
Anope::string last_topic; /* The last topic that was set on this channel */
Anope::string last_topic_setter; /* Setter */
time_t last_topic_time; /* Time */
time_t last_topic_time = 0; /* Time */
Channel::ModeList last_modes; /* The last modes set on this channel */
int16_t bantype;
int16_t bantype = 2;
MemoInfo memos;
@@ -97,7 +97,7 @@ public:
/* For BotServ */
Serialize::Reference<BotInfo> bi; /* Bot used on this channel */
time_t banexpire; /* Time bans expire in */
time_t banexpire = 0; /* Time bans expire in */
/** Constructor
* @param chname The channel name
+3 -11
View File
@@ -106,24 +106,16 @@ ChannelInfo::ChannelInfo(const Anope::string &chname)
: Serializable(CHANNELINFO_TYPE)
, access(CHANACCESS_TYPE)
, akick(AUTOKICK_TYPE)
, name(chname)
, time_registered(Anope::CurTime)
, last_used(Anope::CurTime)
{
if (chname.empty())
throw CoreException("Empty channel passed to ChannelInfo constructor");
this->founder = NULL;
this->successor = NULL;
this->c = Channel::Find(chname);
if (this->c)
this->c->ci = this;
this->banexpire = 0;
this->bi = NULL;
this->last_topic_time = 0;
this->name = chname;
this->bantype = 2;
this->memos.memomax = 0;
this->last_used = this->time_registered = Anope::CurTime;
size_t old = RegisteredChannelList->size();
(*RegisteredChannelList)[this->name] = this;