summaryrefslogtreecommitdiff
path: root/src/regchannel.cpp
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-07 21:46:58 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-07 21:46:58 +0000
commit9047b0347df08f950c8cdbe8b4ea97870bcf76eb (patch)
treec111c82095d381d275b4a2df5dfb6f17211703c9 /src/regchannel.cpp
parent029f39964b2e8f0371ef5bc776d1052d7894e695 (diff)
Made mlock_on, mlock_off, access, and akick private in ChannelInfo
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2630 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/regchannel.cpp')
-rw-r--r--src/regchannel.cpp53
1 files changed, 49 insertions, 4 deletions
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 8727fa176..8e8ca825d 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -20,20 +20,26 @@ ChannelInfo::ChannelInfo()
name[0] = last_topic_setter[0] = '\0';
founder = successor = NULL;
desc = url = email = last_topic = forbidby = forbidreason = NULL;
- time_registered = last_used = last_topic_time = 0;
- flags = 0;
- bantype = 0;
+ last_topic_time = 0;
levels = NULL;
entry_message = NULL;
c = NULL;
bi = NULL;
- botflags = 0;
ttb = NULL;
bwcount = 0;
badwords = NULL;
capsmin = capspercent = 0;
floodlines = floodsecs = 0;
repeattimes = 0;
+
+ /* If ircd doesn't exist, this is from DB load and mlock is set later */
+ if (ircd)
+ mlock_on = ircd->DefMLock;
+ flags = CSDefFlags;
+ bantype = CSDefBantype;
+ memos.memomax = MSMaxMemos;
+ botflags = BSDefFlags;
+ last_used = time_registered = time(NULL);
}
/** Add an entry to the channel access list
@@ -98,6 +104,14 @@ ChanAccess *ChannelInfo::GetAccess(NickCore *nc, int16 level)
return NULL;
}
+/** Get the size of the accss vector for this channel
+ * @return The access vector size
+ */
+const unsigned ChannelInfo::GetAccessCount() const
+{
+ return access.empty() ? 0 : access.size();
+}
+
/** Erase an entry from the channel access list
*
@@ -177,6 +191,26 @@ AutoKick *ChannelInfo::AddAkick(const std::string &user, const std::string &mask
return autokick;
}
+/** Get an entry from the channel akick list
+ * @param index The index in the akick vector
+ * @return The akick structure, or NULL if not found
+ */
+AutoKick *ChannelInfo::GetAkick(unsigned index)
+{
+ if (akick.empty() || index >= akick.size())
+ return NULL;
+
+ return akick[index];
+}
+
+/** Get the size of the akick vector for this channel
+ * @return The akick vector size
+ */
+const unsigned ChannelInfo::GetAkickCount() const
+{
+ return akick.empty() ? 0 : akick.size();
+}
+
/** Erase an entry from the channel akick list
* @param akick The akick
*/
@@ -250,6 +284,17 @@ void ChannelInfo::ClearMLock()
mlock_off.reset();
}
+/** Get the number of mlocked modes for this channel
+ * @param status true for mlock on, false for mlock off
+ * @return The number of mlocked modes
+ */
+const size_t ChannelInfo::GetMLockCount(bool status) const
+{
+ if (status)
+ return mlock_on.count();
+ else
+ return mlock_off.count();
+}
/** Set a channel mode param on the channel
* @param Name The mode