- SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" PRIVMSG "+target->name+" :"+text);
-}
-
-void SpanningTreeProtocolInterface::SendChannelNotice(Channel* target, char status, const std::string &text)
-{
- SendChannel(target, status, ":" + ServerInstance->Config->GetSID()+" NOTICE "+target->name+" :"+text);
-}
-
-void SpanningTreeProtocolInterface::SendUserPrivmsg(User* target, const std::string &text)
-{
- TreeServer* serv = Utils->FindServer(target->server);
- if (serv)
- {
- TreeSocket* sock = serv->GetSocket();
- if (sock)
- {
- sock->WriteLine(":" + ServerInstance->Config->GetSID() + " PRIVMSG " + target->nick + " :"+text);
- }
- }
-}
-
-void SpanningTreeProtocolInterface::SendUserNotice(User* target, const std::string &text)
-{
- TreeServer* serv = Utils->FindServer(target->server);
- if (serv)
- {
- TreeSocket* sock = serv->GetSocket();
- if (sock)
- {
- sock->WriteLine(":" + ServerInstance->Config->GetSID() + " NOTICE " + target->nick + " :"+text);
- }
- }
-}
-
-void SpanningTreeProtocolInterface::Introduce(User* user)
-{
- if (user->quitting)
- return;
- if (IS_LOCAL(user))
- {
- parameterlist params;
- params.push_back(user->uuid);
- params.push_back(ConvToStr(user->age));
- params.push_back(user->nick);
- params.push_back(user->host);
- params.push_back(user->dhost);
- params.push_back(user->ident);
- params.push_back(user->GetIPString());
- params.push_back(ConvToStr(user->signon));
- params.push_back("+"+std::string(user->FormatModes(true)));
- params.push_back(":"+std::string(user->fullname));
- Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params);
- }
-
- TreeServer* SourceServer = Utils->FindServer(user->server);
- if (SourceServer)
- {
- SourceServer->SetUserCount(1); // increment by 1
- }
+ const char* cmd = (msgtype == MSG_PRIVMSG ? "PRIVMSG" : "NOTICE");
+ parameterlist p;
+ p.push_back(target->uuid);
+ p.push_back(":" + text);
+ Utils->DoOneToOne(ServerInstance->Config->GetSID(), cmd, p, target->server);