summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/channels.h3
-rw-r--r--src/channels.cpp7
-rw-r--r--src/coremods/core_channel/cmd_names.cpp2
3 files changed, 4 insertions, 8 deletions
diff --git a/include/channels.h b/include/channels.h
index 628f34f9f..736ca2e98 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -289,8 +289,9 @@ class CoreExport Channel : public Extensible, public InviteBase<Channel>
/** Spool the NAMES list for this channel to the given user
* @param user The user to spool the NAMES list to
+ * @param isinside If true, the user is inside the channel, if not then false
*/
- void UserList(User *user);
+ void UserList(User* user, bool isinside = true);
/** Get the value of a users prefix on this channel.
* @param user The user to look up
diff --git a/src/channels.cpp b/src/channels.cpp
index 485ffd4c9..089b6927e 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -626,7 +626,7 @@ const char* Channel::ChanModes(bool showkey)
/* 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)
+void Channel::UserList(User* user, bool has_user)
{
bool has_privs = user->HasPrivPermission("channels/auspex");
std::string list;
@@ -635,11 +635,6 @@ void Channel::UserList(User *user)
list.append(this->name).append(" :");
std::string::size_type pos = list.size();
- /* Improvement by Brain - this doesnt change in value, so why was it inside
- * the loop?
- */
- bool has_user = this->HasUser(user);
-
const size_t maxlen = ServerInstance->Config->Limits.MaxLine - 10 - ServerInstance->Config->ServerName.size();
std::string prefixlist;
std::string nick;
diff --git a/src/coremods/core_channel/cmd_names.cpp b/src/coremods/core_channel/cmd_names.cpp
index 558ad8407..20faae774 100644
--- a/src/coremods/core_channel/cmd_names.cpp
+++ b/src/coremods/core_channel/cmd_names.cpp
@@ -54,7 +54,7 @@ CmdResult CommandNames::Handle (const std::vector<std::string>& parameters, User
bool has_user = c->HasUser(user);
if ((!c->IsModeSet(secretmode)) || (has_user) || (user->HasPrivPermission("channels/auspex")))
{
- c->UserList(user);
+ c->UserList(user, has_user);
return CMD_SUCCESS;
}
}