From 7e062b086a56f770ca7c3928cd781d0edd05795b Mon Sep 17 00:00:00 2001 From: cflakes Date: Fri, 14 May 2010 08:59:19 +0000 Subject: [PATCH] Made the lastseen table look better by applying more grammarz. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1986 726aef4b-f618-498e-8847-2d620e286838 --- modules/lastseen.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/lastseen.cpp b/modules/lastseen.cpp index 50c2d8a9..4307aa40 100644 --- a/modules/lastseen.cpp +++ b/modules/lastseen.cpp @@ -115,7 +115,8 @@ public: Row["LastSeen"] = buf; } - Row["Info"] = CString(pUser->GetClients().size()) + " client(s)"; + Row["Info"] = CString(pUser->GetClients().size()) + + " client" + CString(pUser->GetClients().size() == 1 ? "" : "s"); if(!pUser->GetCurrentServer()) { Row["Info"] += ", not connected to IRC"; } else { @@ -124,9 +125,13 @@ public: for (unsigned int a = 0; a < vChans.size(); ++a) { if (vChans[a]->IsOn()) ++uChans; } + unsigned int n = uChans; Row["Info"] += ", joined to " + CString(uChans); - if(uChans != vChans.size()) Row["Info"] += " out of " + CString(vChans.size()) + " configured"; - Row["Info"] += " channel(s)"; + if(uChans != vChans.size()) { + Row["Info"] += " out of " + CString(vChans.size()) + " configured"; + n = vChans.size(); + } + Row["Info"] += " channel" + CString(n == 1 ? "" : "s"); } }