X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fchannels.cpp;h=f79b5b89f56c37e221e7aee01f24862d64f660cb;hb=cd268bb2d5d1740233d150e2f3877f7f136d3512;hp=948538ff460d15162048800ceea8c77a218f5954;hpb=4b6f7d789333dd9fd3b08f8742a68c0f9c6c2254;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/channels.cpp b/src/channels.cpp index 948538ff4..f79b5b89f 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -32,9 +32,6 @@ namespace ChanModeReference inviteonlymode(NULL, "inviteonly"); ChanModeReference keymode(NULL, "key"); ChanModeReference limitmode(NULL, "limit"); - ChanModeReference secretmode(NULL, "secret"); - ChanModeReference privatemode(NULL, "private"); - UserModeReference invisiblemode(NULL, "invisible"); } Channel::Channel(const std::string &cname, time_t ts) @@ -344,16 +341,6 @@ Membership* Channel::ForceJoin(User* user, const std::string* privs, bool bursti this->WriteAllExcept(user, !ServerInstance->Config->CycleHostsFromUser, 0, except_list, "MODE %s +%s", this->name.c_str(), ms.c_str()); } - if (IS_LOCAL(user)) - { - if (this->topicset) - { - user->WriteNumeric(RPL_TOPIC, "%s :%s", this->name.c_str(), this->topic.c_str()); - user->WriteNumeric(RPL_TOPICTIME, "%s %s %lu", this->name.c_str(), this->setby.c_str(), (unsigned long)this->topicset); - } - this->UserList(user); - } - FOREACH_MOD(OnPostJoin, (memb)); return memb; } @@ -586,66 +573,6 @@ const char* Channel::ChanModes(bool showkey) return scratch.c_str(); } -/* compile a userlist of a channel into a string, each nick seperated by - * spaces and op, voice etc status shown as @ and +, and send it to 'user' - */ -void Channel::UserList(User* user, bool has_user) -{ - bool has_privs = user->HasPrivPermission("channels/auspex"); - std::string list; - list.push_back(this->IsModeSet(secretmode) ? '@' : this->IsModeSet(privatemode) ? '*' : '='); - list.push_back(' '); - list.append(this->name).append(" :"); - std::string::size_type pos = list.size(); - - const size_t maxlen = ServerInstance->Config->Limits.MaxLine - 10 - ServerInstance->Config->ServerName.size(); - std::string prefixlist; - std::string nick; - for (MemberMap::iterator i = userlist.begin(); i != userlist.end(); ++i) - { - if ((!has_user) && (i->first->IsModeSet(invisiblemode)) && (!has_privs)) - { - /* - * user is +i, and source not on the channel, does not show - * nick in NAMES list - */ - continue; - } - - Membership* memb = i->second; - - prefixlist.clear(); - char prefix = memb->GetPrefixChar(); - if (prefix) - prefixlist.push_back(prefix); - nick = i->first->nick; - - ModResult res; - FIRST_MOD_RESULT(OnNamesListItem, res, (user, memb, prefixlist, nick)); - - // See if a module wants us to exclude this user from NAMES - if (res == MOD_RES_DENY) - continue; - - if (list.size() + prefixlist.length() + nick.length() + 1 > maxlen) - { - /* list overflowed into multiple numerics */ - user->WriteNumeric(RPL_NAMREPLY, list); - - // Erase all nicks, keep the constant part - list.erase(pos); - } - - list.append(prefixlist).append(nick).push_back(' '); - } - - // Only send the user list numeric if there is at least one user in it - if (list.size() != pos) - user->WriteNumeric(RPL_NAMREPLY, list); - - user->WriteNumeric(RPL_ENDOFNAMES, "%s :End of /NAMES list.", this->name.c_str()); -} - /* returns the status character for a given user on a channel, e.g. @ for op, * % for halfop etc. If the user has several modes set, the highest mode * the user has must be returned.