← Back to team overview

mira-dev team mailing list archive

[Branch ~mira-dev/mira/trunk] Rev 198: Only attempt to send Status updates for users that are logged in to the server

 

------------------------------------------------------------
revno: 198
fixes bug(s): https://launchpad.net/bugs/570491
committer: Alan Alvarez <aalvarez@xxxxxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-04-29 12:31:45 -0400
message:
  Only attempt to send Status updates for users that are logged in to the server
modified:
  mira-server/src/network/TcpConnection.cpp


--
lp:mira
https://code.launchpad.net/~mira-dev/mira/trunk

Your team Mira Core Development Team is subscribed to branch lp:mira.
To unsubscribe from this branch go to https://code.launchpad.net/~mira-dev/mira/trunk/+edit-subscription
=== modified file 'mira-server/src/network/TcpConnection.cpp'
--- mira-server/src/network/TcpConnection.cpp	2010-04-16 18:39:52 +0000
+++ mira-server/src/network/TcpConnection.cpp	2010-04-29 16:31:45 +0000
@@ -45,7 +45,13 @@
 TcpConnection::~TcpConnection()
 {
     if(is_logged_in())
+    {
         Application::get_server().remove_connection(m_user_id);
+        string message = "US " + Application::get_directory().find_user(m_user_id).get_username() + " LO";
+        Msg *msg = new MsgUserStatus(this, message);
+        msg->run();
+        delete msg;
+    }
 
     // delete pending messages in queue.
     // TODO: We might actually want to process these messages before deleting this object
@@ -53,11 +59,6 @@
     for (unsigned int i = 0;  i < size; ++i, m_message_queue.pop())
         delete m_message_queue.front();
 
-    string message = "US " + Application::get_directory().find_user(m_user_id).get_username() + " LO";
-    Msg *msg = new MsgUserStatus(this, message);
-    msg->run();
-    delete msg;
-
     cout << "dropping connection" << endl;
 
     close_socket(m_socket);