-void User::WriteCommon(const std::string &text)
-{
- bool sent_to_at_least_one = false;
- char tb[MAXBUF];
-
- if (this->registered != REG_ALL)
- return;
-
- uniq_id++;
-
- if (!already_sent)
- InitializeAlreadySent(ServerInstance->SE);
-
- /* We dont want to be doing this n times, just once */
- snprintf(tb,MAXBUF,":%s %s",this->GetFullHost().c_str(),text.c_str());
- std::string out = tb;
-
- for (UCListIter v = this->chans.begin(); v != this->chans.end(); v++)
- {
- const UserMembList* ulist = (*v)->GetUsers();
- for (UserMembList::const_iterator i = ulist->begin(); i != ulist->end(); i++)
- {
- if ((IS_LOCAL(i->first)) && (already_sent[i->first->fd] != uniq_id))
- {
- already_sent[i->first->fd] = uniq_id;
- i->first->Write(out);
- sent_to_at_least_one = true;
- }
- }
- }
-
- /*
- * if the user was not in any channels, no users will receive the text. Make sure the user
- * receives their OWN message for WriteCommon
- */
- if (!sent_to_at_least_one)
- {
- this->Write(std::string(tb));
- }
-}
-
-
-/* write a formatted string to all users who share at least one common
- * channel, NOT including the source user e.g. for use in QUIT
- */
-