summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp18
-rw-r--r--src/modules/m_md5.cpp2
2 files changed, 12 insertions, 8 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 5539f4bfe..4a927cedb 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -274,7 +274,7 @@ Channel* Channel::JoinUser(User *user, const char* cn, bool override, const char
if (!IS_LOCAL(user))
{
if (!TS)
- ServerInstance->Logs->Log("CHANNEL",DEBUG,"*** BUG *** Channel::JoinUser called for REMOTE user '%s' on channel '%s' but no TS given!", user->nick.c_str(), cn);
+ ServerInstance->Logs->Log("CHANNELS",DEBUG,"*** BUG *** Channel::JoinUser called for REMOTE user '%s' on channel '%s' but no TS given!", user->nick.c_str(), cn);
}
else
{
@@ -400,11 +400,15 @@ Channel* Channel::ForceChan(Channel* Ptr, User* user, const std::string &privs,
Ptr->WriteAllExcept(user, false, 0, except_list, "JOIN :%s", Ptr->name.c_str());
/* Theyre not the first ones in here, make sure everyone else sees the modes we gave the user */
- std::string ms = memb->modes;
- for(unsigned int i=0; i < memb->modes.length(); i++)
- ms.append(" ").append(user->nick);
- if ((Ptr->GetUserCounter() > 1) && (ms.length()))
- Ptr->WriteAllExceptSender(user, ServerInstance->Config->CycleHostsFromUser, 0, "MODE %s +%s", Ptr->name.c_str(), ms.c_str());
+ if ((Ptr->GetUserCounter() > 1) && (!memb->modes.empty()))
+ {
+ std::string ms = memb->modes;
+ for(unsigned int i=0; i < memb->modes.length(); i++)
+ ms.append(" ").append(user->nick);
+
+ except_list.insert(user);
+ Ptr->WriteAllExcept(user, !ServerInstance->Config->CycleHostsFromUser, 0, except_list, "MODE %s +%s", Ptr->name.c_str(), ms.c_str());
+ }
if (IS_LOCAL(user))
{
@@ -655,7 +659,7 @@ void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList
if (!text)
return;
- int offset = snprintf(textbuffer,MAXBUF,":%s ", user->GetFullHost().c_str());
+ int offset = snprintf(textbuffer,MAXBUF,":%s ", serversource ? ServerInstance->Config->ServerName.c_str() : user->GetFullHost().c_str());
va_start(argsPtr, text);
vsnprintf(textbuffer + offset, MAXBUF - offset, text, argsPtr);
diff --git a/src/modules/m_md5.cpp b/src/modules/m_md5.cpp
index f8f13dcbc..14ccf16a8 100644
--- a/src/modules/m_md5.cpp
+++ b/src/modules/m_md5.cpp
@@ -158,7 +158,7 @@ class MD5Provider : public HashProvider
byteSwap(ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
- memset(ctx, 0, sizeof(ctx));
+ memset(ctx, 0, sizeof(*ctx));
}
void MD5Transform(word32 buf[4], word32 const in[16])