void SendTopic(const MessageSource &source, Channel *c) override { ServiceBot *bi = source.GetBot(); bool needjoin = c->FindUser(bi) == NULL; if (needjoin) { ChannelStatus status; status.AddMode('o'); bi->Join(c, &status); } IRCDProto::SendTopic(source, c); if (needjoin) bi->Part(c); }
/* JOIN - SJOIN */ void SendJoin(User *user, Channel *c, const ChannelStatus *status) { UplinkSocket::Message(user->nick) << "SJOIN " << c->creation_time << " " << c->name; if (status) { /* First save the channel status incase uc->Status == status */ ChannelStatus cs = *status; /* If the user is internally on the channel with flags, kill them so that * the stacker will allow this. */ UserContainer *uc = c->FindUser(user); if (uc != NULL) uc->Status->ClearFlags(); BotInfo *setter = findbot(user->nick); for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i) if (cs.HasFlag(ModeManager::ChannelModes[i]->Name)) c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false); } }
void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { UplinkSocket::Message(user) << "JOIN " << c->name; if (status) { /* First save the channel status incase uc->Status == status */ ChannelStatus cs = *status; /* If the user is internally on the channel with flags, kill them so that * the stacker will allow this. */ ChanUserContainer *uc = c->FindUser(user); if (uc != NULL) uc->status.Clear(); ServiceBot *setter = ServiceBot::Find(user->GetUID()); for (size_t i = 0; i < cs.Modes().length(); ++i) c->SetMode(setter, ModeManager::FindChannelModeByChar(cs.Modes()[i]), user->GetUID(), false); if (uc != NULL) uc->status = cs; } }
void bahamut::senders::Join::Send(User* user, Channel* c, const ChannelStatus* status) { Uplink::Send(user, "SJOIN", c->creation_time, c->name); if (status) { /* First save the channel status incase uc->Status == status */ ChannelStatus cs = *status; /* If the user is internally on the channel with flags, kill them so that * the stacker will allow this. */ ChanUserContainer *uc = c->FindUser(user); if (uc != NULL) uc->status.Clear(); ServiceBot *setter = ServiceBot::Find(user->GetUID()); for (size_t i = 0; i < cs.Modes().length(); ++i) c->SetMode(setter, ModeManager::FindChannelModeByChar(cs.Modes()[i]), user->GetUID(), false); if (uc != NULL) uc->status = cs; } }