#include "wildcard.h"
#include "message.h"
+using namespace std;
+
extern int MODCOUNT;
extern vector<Module*> modules;
extern vector<ircd_module*> factory;
{
if ((u->chans[i].channel != NULL) && (u2->chans[z].channel != NULL))
{
- if ((u->chans[i].channel == u2->chans[z].channel) && (u->chans[i].channel) && (u2->chans[z].channel) && (u->registered == 7) && (u2->registered == 7))
+ if ((!strcasecmp(u->chans[i].channel->name,u2->chans[z].channel->name)) && (u->chans[i].channel) && (u2->chans[z].channel) && (u->registered == 7) && (u2->registered == 7))
{
if ((c_count(u)) && (c_count(u2)))
{
void ChangeName(userrec* user, const char* gecos)
{
strncpy(user->fullname,gecos,MAXBUF);
-
- // TODO: replace these with functions:
- // NetSendToAll - to all
- // NetSendToCommon - to all that hold users sharing a common channel with another user
- // NetSendToOne - to one server
- // NetSendToAllExcept - send to all but one
- // all by servername
-
char buffer[MAXBUF];
snprintf(buffer,MAXBUF,"a %s :%s",user->nick,gecos);
NetSendToAll(buffer);
int i;
for (int i = 0; i != MAXCHANS; i++)
{
- if ((user->chans[i].channel == chan) && (chan != NULL))
+ if (u->chans[i].channel)
{
- if ((user->chans[i].uc_modes & UCMODE_OP) > 0)
- {
- return "@";
- }
- if ((user->chans[i].uc_modes & UCMODE_HOP) > 0)
- {
- return "%";
- }
- if ((user->chans[i].uc_modes & UCMODE_VOICE) > 0)
+ if ((!strcasecmp(u->chans[i].channel->name,chan->name)) && (chan != NULL))
{
- return "+";
+ if ((user->chans[i].uc_modes & UCMODE_OP) > 0)
+ {
+ return "@";
+ }
+ if ((user->chans[i].uc_modes & UCMODE_HOP) > 0)
+ {
+ return "%";
+ }
+ if ((user->chans[i].uc_modes & UCMODE_VOICE) > 0)
+ {
+ return "+";
+ }
+ return "";
}
- return "";
}
}
}
for (int i = 0; i != MAXCHANS; i++)
{
- if ((user->chans[i].channel == chan) && (chan != NULL))
+ if (u->chans[i].channel)
{
- if ((user->chans[i].uc_modes & UCMODE_OP) > 0)
+ if ((!strcasecmp(u->chans[i].channel->name,chan->name)) && (chan != NULL))
{
- return STATUS_OP;
- }
- if ((user->chans[i].uc_modes & UCMODE_HOP) > 0)
- {
- return STATUS_HOP;
- }
- if ((user->chans[i].uc_modes & UCMODE_VOICE) > 0)
- {
- return STATUS_VOICE;
+ if ((user->chans[i].uc_modes & UCMODE_OP) > 0)
+ {
+ return STATUS_OP;
+ }
+ if ((user->chans[i].uc_modes & UCMODE_HOP) > 0)
+ {
+ return STATUS_HOP;
+ }
+ if ((user->chans[i].uc_modes & UCMODE_VOICE) > 0)
+ {
+ return STATUS_VOICE;
+ }
+ return STATUS_NORMAL;
}
- return STATUS_NORMAL;
}
}
}
}
for (int i =0; i != MAXCHANS; i++)
{
- if (u->chans[i].channel == c)
+ if (u->chans[i].channel)
{
- return 1;
+ if (!strcasecmp(u->chans[i].channel->name,c->name))
+ {
+ return 1;
+ }
}
}
return 0;