summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index a77947126..a55fbcb88 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -176,11 +176,80 @@ void chanrec::DelUser(char* castuser)
log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
}
+void chanrec::AddOppedUser(char* castuser)
+{
+ internal_op_userlist[castuser] = castuser;
+ log(DEBUG,"Added casted user to channel's internal list");
+}
+
+void chanrec::DelOppedUser(char* castuser)
+{
+ std::map<char*,char*>::iterator a = internal_op_userlist.find(castuser);
+ if (a != internal_op_userlist.end())
+ {
+ log(DEBUG,"Removed casted user from channel's internal list");
+ internal_op_userlist.erase(a);
+ return;
+ }
+ log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
+}
+
+void chanrec::AddHalfoppedUser(char* castuser)
+{
+ internal_halfop_userlist[castuser] = castuser;
+ log(DEBUG,"Added casted user to channel's internal list");
+}
+
+void chanrec::DelHalfoppedUser(char* castuser)
+{
+ std::map<char*,char*>::iterator a = internal_halfop_userlist.find(castuser);
+ if (a != internal_halfop_userlist.end())
+ {
+ log(DEBUG,"Removed casted user from channel's internal list");
+ internal_halfop_userlist.erase(a);
+ return;
+ }
+ log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
+}
+
+void chanrec::AddVoicedUser(char* castuser)
+{
+ internal_voice_userlist[castuser] = castuser;
+ log(DEBUG,"Added casted user to channel's internal list");
+}
+
+void chanrec::DelOppedUser(char* castuser)
+{
+ std::map<char*,char*>::iterator a = internal_voice_userlist.find(castuser);
+ if (a != internal_voice_userlist.end())
+ {
+ log(DEBUG,"Removed casted user from channel's internal list");
+ internal_voice_userlist.erase(a);
+ return;
+ }
+ log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name);
+}
+
std::map<char*,char*> *chanrec::GetUsers()
{
return &internal_userlist;
}
+std::map<char*,char*> *chanrec::GetOppedUsers()
+{
+ return &internal_op_userlist;
+}
+
+std::map<char*,char*> *chanrec::GetHalfoppedUsers()
+{
+ return &internal_halfop_userlist;
+}
+
+std::map<char*,char*> *chanrec::GetVoicedUsers()
+{
+ return &internal_voice_userlist;
+}
+
/* add a channel to a user, creating the record for it if needed and linking
* it to the user record */
@@ -369,6 +438,7 @@ chanrec* ForceChan(chanrec* Ptr,ucrec &a,userrec* user, int created)
{
/* first user in is given ops */
a.uc_modes = UCMODE_OP;
+ Ptr->AddOppedUser((char*)user);
}
else
{