Bug 103670 - To keep inform in the query window when the contact disconect
Summary: To keep inform in the query window when the contact disconect
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mandrake RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-11 17:25 UTC by Nicolas L.
Modified: 2006-01-13 00:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas L. 2005-04-11 17:25:14 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Mandrake RPMs

it would be nice if in the query windows a message tell us if the contact disconnect
Comment 1 Dario Abatianni 2006-01-13 00:28:50 UTC
SVN commit 497517 by abatianni:

BUG:103670 - show quit and reason in query if we see a nick leave the server

 M  +13 -0     query.cpp  
 M  +6 -0      query.h  
 M  +7 -1      server.cpp  


--- trunk/extragear/network/konversation/src/query.cpp #497516:497517
@@ -484,4 +484,17 @@
     emit updateInfo(info);
 }
 
+// show quit message of nick if we see it
+void Query::quitNick(const QString& reason)
+{
+  QString displayReason;
+
+  if(!reason.isEmpty())
+  {
+    displayReason=" ("+reason+")";
+  }
+
+  appendCommandMessage(i18n("Quit"),i18n("%1 has left this server%2.").arg(getName()).arg(displayReason),false);
+}
+
 #include "query.moc"
--- trunk/extragear/network/konversation/src/query.h #497516:497517
@@ -62,6 +62,12 @@
 
         virtual bool areIRCColorsSupported() {return true; }
         virtual bool isInsertCharacterSupported() { return true; }
+
+        /** call this when you see a nick quit from the server.
+         *  @param reason The quit reason given by that user.
+         */
+        void quitNick(const QString& reason);
+
         signals:
         void sendFile(const QString& recipient);
 
--- trunk/extragear/network/konversation/src/server.cpp #497516:497517
@@ -1034,7 +1034,7 @@
         m_processingIncoming = true;
         QString front(inputBuffer.front());
         inputBuffer.pop_front();
-        if(rawLog) 
+        if(rawLog)
         {
             QString toRaw = front;
             rawLog->appendRaw("&gt;&gt; " + toRaw.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;"));
@@ -2678,6 +2678,12 @@
         channel=nextchannel;
     }
 
+    Query* query=getQueryByName(nickname);
+    if(query)
+    {
+      query->quitNick(reason);
+    }
+
     // Delete the nick from all channels and then delete the nickinfo,
     // emitting signal if on the watch list.
     setNickOffline(nickname);