summaryrefslogtreecommitdiff
path: root/modules/protocol/unreal.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-12-28 04:31:44 -0500
committerAdam <Adam@anope.org>2011-12-28 04:31:44 -0500
commita4bf770a49e8e0df31b45859924bf002c141b2eb (patch)
tree6b622d790a4a06f172e6fa3d732f8b48e0b26420 /modules/protocol/unreal.cpp
parent150831c1a6538938c13c06a10f1eede2079a8aa4 (diff)
Added ESVID support to unreal32
Also fixes a crash due to unreal's ESVID change when users connect.
Diffstat (limited to 'modules/protocol/unreal.cpp')
-rw-r--r--modules/protocol/unreal.cpp38
1 files changed, 31 insertions, 7 deletions
diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp
index 5a5a2fd55..e4abefce3 100644
--- a/modules/protocol/unreal.cpp
+++ b/modules/protocol/unreal.cpp
@@ -197,13 +197,14 @@ class UnrealIRCdProto : public IRCDProto
NOQUIT = No Quit
TKLEXT = Extended TKL we don't use it but best to have it
SJB64 = Base64 encoded time stamps
+ ESVID = Allows storing account names as services stamp
VL = Version Info
NS = Config->Numeric Server
*/
if (!Config->Numeric.empty())
- UplinkSocket::Message() << "PROTOCTL NICKv2 VHP UMODE2 NICKIP TOKEN SJOIN SJOIN2 SJ3 NOQUIT TKLEXT VL";
+ UplinkSocket::Message() << "PROTOCTL NICKv2 VHP UMODE2 NICKIP TOKEN SJOIN SJOIN2 SJ3 NOQUIT TKLEXT ESVID VL";
else
- UplinkSocket::Message() << "PROTOCTL NICKv2 VHP UMODE2 NICKIP TOKEN SJOIN SJOIN2 SJ3 NOQUIT TKLEXT";
+ UplinkSocket::Message() << "PROTOCTL NICKv2 VHP UMODE2 NICKIP TOKEN SJOIN SJOIN2 SJ3 NOQUIT TKLEXT ESVID";
UplinkSocket::Message() << "PASS :" << Config->Uplinks[CurrentUplink]->password;
SendServer(Me);
}
@@ -305,7 +306,10 @@ class UnrealIRCdProto : public IRCDProto
return;
BotInfo *ns = findbot(Config->NickServ);
- ircdproto->SendMode(ns, u, "+d %d", u->timestamp);
+ if (Capab.count("ESVID") > 0)
+ ircdproto->SendMode(ns, u, "+d %s", u->Account()->display.c_str());
+ else
+ ircdproto->SendMode(ns, u, "+d %d", u->timestamp);
}
void SendLogout(User *u)
@@ -523,9 +527,19 @@ class Unreal32IRCdMessage : public IRCdMessage
User *user = do_nick(source, params[0], params[3], params[4], params[5], params[10], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, ip.addr(), vhost, "", params[7]);
if (user)
{
- NickAlias *na = findnick(user->nick);
+ NickAlias *na = NULL;
+
+ if (params[6].is_pos_number_only())
+ {
+ if (convertTo<time_t>(params[6]) == user->timestamp)
+ na = findnick(user->nick);
+ }
+ else if (params[6] != "*")
+ {
+ na = findnick(params[6]);
+ }
- if (na && user->timestamp == convertTo<time_t>(params[6]))
+ if (na)
{
user->Login(na->nc);
if (!Config->NoNicknameOwnership && na->nc->HasFlag(NI_UNCONFIRMED) == false && nickserv)
@@ -545,9 +559,19 @@ class Unreal32IRCdMessage : public IRCdMessage
User *user = do_nick(source, params[0], params[3], params[4], params[5], params[9], Anope::string(params[2]).is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, "", vhost, "", params[7]);
if (user)
{
- NickAlias *na = findnick(user->nick);
+ NickAlias *na = NULL;
+
+ if (params[6].is_pos_number_only())
+ {
+ if (convertTo<time_t>(params[6]) == user->timestamp)
+ na = findnick(user->nick);
+ }
+ else if (params[6] != "*")
+ {
+ na = findnick(params[6]);
+ }
- if (na && user->timestamp == convertTo<time_t>(params[6]))
+ if (na)
{
user->Login(na->nc);
if (!Config->NoNicknameOwnership && na->nc->HasFlag(NI_UNCONFIRMED) == false && nickserv)