@@ -153,7+156,8 @@ class ModuleServicesAccount : public Module
virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
{
virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
{
- char *account = user->GetExt("accountname");
+ std::string *account;
+ user->GetExt("accountname", account);
if (target_type == TYPE_CHANNEL)
{
if (target_type == TYPE_CHANNEL)
{
@@ -161,14+165,14 @@ class ModuleServicesAccount : public Module
if ((c->IsModeSet('M')) && (!account))
{
if ((c->IsModeSet('M')) && (!account))
{
- if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!strcmp(user->server,"")))
+ if ((ServerInstance->IsUlined(user->nick)) || (ServerInstance->IsUlined(user->server)) || (!strcmp(user->server,"")))
{
// user is ulined, can speak regardless
return 0;
}
// user messaging a +M channel and is not registered
{
// user is ulined, can speak regardless
return 0;
}
// user messaging a +M channel and is not registered
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(c->name)+" :You need to be identified to a registered account to message this channel");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(c->name)+" :You need to be identified to a registered account to message this channel");
return 1;
}
}
return 1;
}
}
@@ -178,14+182,14 @@ class ModuleServicesAccount : public Module
if ((u->modes['R'-65]) && (!account))
{
if ((u->modes['R'-65]) && (!account))
{
- if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)))
+ if ((ServerInstance->IsUlined(user->nick)) || (ServerInstance->IsUlined(user->server)))
{
// user is ulined, can speak regardless
return 0;
}
// user messaging a +R user and is not registered
{
// user is ulined, can speak regardless
return 0;
}
// user messaging a +R user and is not registered
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(u->nick)+" :You need to be identified to a registered account to message this user");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(u->nick)+" :You need to be identified to a registered account to message this user");
return 1;
}
}
return 1;
}
}
@@ -199,7+203,8 @@ class ModuleServicesAccount : public Module
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
{
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
{
- char *account = user->GetExt("accountname");
+ std::string *account;
+ user->GetExt("accountname", account);
if (chan)
{
if (chan)
{
@@ -207,13+212,13 @@ class ModuleServicesAccount : public Module
{
if (!account)
{
{
if (!account)
{
- if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)))
+ if ((ServerInstance->IsUlined(user->nick)) || (ServerInstance->IsUlined(user->server)))
{
// user is ulined, won't be stopped from joining
return 0;
}
// joining a +R channel and not identified
{
// user is ulined, won't be stopped from joining
return 0;
}
// joining a +R channel and not identified
- Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(chan->name)+" :You need to be identified to a registered account to join this channel");
+ user->WriteServ("477 "+std::string(user->nick)+" "+std::string(chan->name)+" :You need to be identified to a registered account to join this channel");
return 1;
}
}
return 1;
}
}
@@ -232,11+237,10 @@ class ModuleServicesAccount : public Module
if (extname == "accountname")
{
// check if this user has an swhois field to send
if (extname == "accountname")
{
// check if this user has an swhois field to send
- char* field = user->GetExt("accountname");
- if (field)
+ std::string* account;
+ user->GetExt("accountname", account);
+ if (account)
{
{
- // get our extdata out with a cast
- std::string* account = (std::string*)field;
// call this function in the linking module, let it format the data how it
// sees fit, and send it on its way. We dont need or want to know how.