From cf2d41558a0affc13f18bc2ec3a9c81d2a7b82ee Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 9 Jan 2007 00:49:40 +0000 Subject: Tidy up (optimize, improve) chanrec::WriteChannelWithServ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6269 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/channels.cpp b/src/channels.cpp index 21af27177..1320ebd3d 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -641,11 +641,15 @@ void chanrec::WriteChannelWithServ(const char* ServName, const char* text, ...) void chanrec::WriteChannelWithServ(const char* ServName, const std::string &text) { CUList *ulist = this->GetUsers(); + char tb[MAXBUF]; + + snprintf(tb,MAXBUF,":%s %s",ServName ? ServName : ServerInstance->Config->ServerName, text.c_str()); + std::string out = tb; for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++) { if (IS_LOCAL(i->second)) - i->second->WriteServ(text); + i->second->Write(out); } } -- cgit v1.2.3