summaryrefslogtreecommitdiff
path: root/modules/protocol/bahamut.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-02-19 20:54:55 -0500
committerAdam <Adam@anope.org>2012-02-19 20:54:55 -0500
commitb84e0804636d3868684c6ec2670207e7ae1cadeb (patch)
tree059be9a9da7b530970bc44f2c8eee5f61497a82e /modules/protocol/bahamut.cpp
parent0ba58d7d0eea4e2a0e0d18a66880f84af6fea60e (diff)
Made our message sources actual clients/servers, and put in a few more default messages for very standard things (KICK etc)
Diffstat (limited to 'modules/protocol/bahamut.cpp')
-rw-r--r--modules/protocol/bahamut.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp
index 8645c7176..078e19a7d 100644
--- a/modules/protocol/bahamut.cpp
+++ b/modules/protocol/bahamut.cpp
@@ -13,8 +13,8 @@
#include "module.h"
-IRCDVar myIrcd[] = {
- {"Bahamut 1.8.x", /* ircd name */
+IRCDVar myIrcd = {
+ "Bahamut 1.8.x", /* ircd name */
"+", /* Modes used by pseudoclients */
1, /* SVSNICK */
0, /* Vhost */
@@ -35,10 +35,7 @@ IRCDVar myIrcd[] = {
0, /* ts6 */
"$", /* TLD Prefix for Global */
6, /* Max number of modes we can send per line */
- 0, /* IRCd sends a SSL users certificate fingerprint */
- }
- ,
- {NULL}
+ 0 /* IRCd sends a SSL users certificate fingerprint */
};
@@ -47,26 +44,34 @@ class BahamutIRCdProto : public IRCDProto
void SendModeInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf) anope_override
{
if (Capab.count("TSMODE") > 0)
- UplinkSocket::Message(source ? source->nick : Config->ServerName) << "MODE " << dest->name << " " << dest->creation_time << " " << buf;
+ {
+ if (source)
+ UplinkSocket::Message(source) << "MODE " << dest->name << " " << dest->creation_time << " " << buf;
+ else
+ UplinkSocket::Message(Me) << "MODE " << dest->name << " " << dest->creation_time << " " << buf;
+ }
else
- UplinkSocket::Message(source ? source->nick : Config->ServerName) << "MODE " << dest->name << " " << buf;
+ IRCDProto::SendModeInternal(source, dest, buf);
}
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf) anope_override
{
- UplinkSocket::Message(bi ? bi->nick : Config->ServerName) << "SVSMODE " << u->nick << " " << u->timestamp << " " << buf;
+ if (bi)
+ UplinkSocket::Message(bi) << "SVSMODE " << u->nick << " " << u->timestamp << " " << buf;
+ else
+ UplinkSocket::Message(Me) << "SVSMODE " << u->nick << " " << u->timestamp << " " << buf;
}
/* SVSHOLD - set */
void SendSVSHold(const Anope::string &nick) anope_override
{
- UplinkSocket::Message(Config->ServerName) << "SVSHOLD " << nick << " " << Config->NSReleaseTimeout << " :Being held for registered user";
+ UplinkSocket::Message(Me) << "SVSHOLD " << nick << " " << Config->NSReleaseTimeout << " :Being held for registered user";
}
/* SVSHOLD - release */
void SendSVSHoldDel(const Anope::string &nick) anope_override
{
- UplinkSocket::Message(Config->ServerName) << "SVSHOLD " << nick << " 0";
+ UplinkSocket::Message(Me) << "SVSHOLD " << nick << " 0";
}
/* SQLINE */
@@ -124,7 +129,7 @@ class BahamutIRCdProto : public IRCDProto
/* TOPIC */
void SendTopic(BotInfo *whosets, Channel *c) anope_override
{
- UplinkSocket::Message(whosets->nick) << "TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_time << " :" << c->topic;
+ UplinkSocket::Message(whosets) << "TOPIC " << c->name << " " << c->topic_setter << " " << c->topic_time << " :" << c->topic;
}
/* UNSQLINE */
@@ -136,7 +141,7 @@ class BahamutIRCdProto : public IRCDProto
/* JOIN - SJOIN */
void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
{
- UplinkSocket::Message(user->nick) << "SJOIN " << c->creation_time << " " << c->name;
+ UplinkSocket::Message(user) << "SJOIN " << c->creation_time << " " << c->name;
if (status)
{
/* First save the channel status incase uc->Status == status */
@@ -169,7 +174,10 @@ class BahamutIRCdProto : public IRCDProto
*/
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf) anope_override
{
- UplinkSocket::Message(source ? source->nick : "") << "SVSKILL " << user->nick << " :" << buf;
+ if (source)
+ UplinkSocket::Message(source) << "SVSKILL " << user->nick << " :" << buf;
+ else
+ UplinkSocket::Message() << "SVSKILL " << user->nick << " :" << buf;
}
void SendBOB() anope_override
@@ -182,14 +190,6 @@ class BahamutIRCdProto : public IRCDProto
UplinkSocket::Message() << "BURST 0";
}
- void SendKickInternal(const BotInfo *source, const Channel *chan, const User *user, const Anope::string &buf) anope_override
- {
- if (!buf.empty())
- UplinkSocket::Message(source->nick) << "KICK " << chan->name << " " << user->nick << " :" << buf;
- else
- UplinkSocket::Message(source->nick) << "KICK " << chan->name << " " << user->nick;
- }
-
void SendClientIntroduction(const User *u) anope_override
{
Anope::string modes = "+" + u->GetModes();
@@ -544,7 +544,7 @@ class ProtoBahamut : public Module
{
this->SetAuthor("Anope");
- pmodule_ircd_var(myIrcd);
+ pmodule_ircd_var(&myIrcd);
pmodule_ircd_proto(&this->ircd_proto);
pmodule_ircd_message(&this->ircd_message);