irc::tokenstream users((params.size() > 2) ? params[2] : ""); /* users from the user list */
bool apply_other_sides_modes = true; /* True if we are accepting the other side's modes */
Channel* chan = this->Instance->FindChan(channel); /* The channel we're sending joins to */
- time_t ourTS = chan ? chan->age : Instance->Time(true)+600; /* The TS of our side of the link */
+ time_t ourTS = chan ? chan->age : Instance->Time()+600; /* The TS of our side of the link */
bool created = !chan; /* True if the channel doesnt exist here yet */
std::string item; /* One item in the list of nicks */
if (!TS)
{
- Instance->Log(DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
+ Instance->Logs->Log("m_spanningtree",DEFAULT,"*** BUG? *** TS of 0 sent to FJOIN. Are some services authors smoking craq, or is it 1970 again?. Dropped.");
Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending FJOIN with a TS of zero. Total craq. Command was dropped.", source.c_str());
return true;
}
const char* usr = item.c_str();
if (usr && *usr)
{
- const char* permissions = usr;
- /* Iterate through all the prefix values, convert them from prefixes to mode letters */
+ const char* unparsedmodes = usr;
std::string modes;
- while ((*permissions) && (*permissions != ','))
+
+
+ /* Iterate through all modes for this user and check they are valid. */
+ while ((*unparsedmodes) && (*unparsedmodes != ','))
{
- ModeHandler* mh = Instance->Modes->FindPrefix(*permissions);
+ ModeHandler *mh = Instance->Modes->FindMode(*unparsedmodes, MODETYPE_CHANNEL);
if (mh)
- modes = modes + mh->GetModeChar();
+ modes += *unparsedmodes;
else
{
- this->SendError(std::string("Invalid prefix '")+(*permissions)+"' in FJOIN");
+ this->SendError(std::string("Invalid prefix '")+(*unparsedmodes)+"' in FJOIN");
return false;
}
+
usr++;
- permissions++;
+ unparsedmodes++;
}
+
/* Advance past the comma, to the nick */
usr++;
if ((!route_back_again) || (route_back_again->GetSocket() != this))
continue;
- /* Add any permissions this user had to the mode stack */
+ /* Add any modes this user had to the mode stack */
for (std::string::iterator x = modes.begin(); x != modes.end(); ++x)
modestack.Push(*x, who->nick);
}
else
{
- Instance->Log(SPARSE,"Warning! Invalid user %s in FJOIN to channel %s IGNORED", usr, channel.c_str());
+ Instance->Logs->Log("m_spanningtree",SPARSE,"Warning! Invalid user %s in FJOIN to channel %s IGNORED", usr, channel.c_str());
continue;
}
}