fixes #525 - using 'away' as ultimate fallback if no away reason is specified
authorMarcus Eggenberger <egs@quassel-irc.org>
Sat, 14 Feb 2009 00:49:36 +0000 (01:49 +0100)
committerMarcus Eggenberger <egs@quassel-irc.org>
Sat, 14 Feb 2009 00:49:36 +0000 (01:49 +0100)
src/core/coresession.cpp
src/core/userinputhandler.cpp

index c90e7f6..926fc97 100644 (file)
@@ -379,7 +379,6 @@ void CoreSession::clientsConnected() {
   Identity *identity = 0;
   CoreNetwork *net = 0;
   IrcUser *me = 0;
   Identity *identity = 0;
   CoreNetwork *net = 0;
   IrcUser *me = 0;
-  QString awayReason;
   while(netIter != _networks.end()) {
     net = *netIter;
     netIter++;
   while(netIter != _networks.end()) {
     net = *netIter;
     netIter++;
@@ -421,8 +420,6 @@ void CoreSession::clientsDisconnected() {
     if(identity->detachAwayEnabled() && !me->isAway()) {
       if(identity->detachAwayReasonEnabled())
        awayReason = identity->detachAwayReason();
     if(identity->detachAwayEnabled() && !me->isAway()) {
       if(identity->detachAwayReasonEnabled())
        awayReason = identity->detachAwayReason();
-      else
-       awayReason = identity->awayReason();
       net->setAutoAwayActive(true);
       net->userInputHandler()->handleAway(BufferInfo(), awayReason);
     }
       net->setAutoAwayActive(true);
       net->userInputHandler()->handleAway(BufferInfo(), awayReason);
     }
index e0449be..8fe87b0 100644 (file)
@@ -63,8 +63,12 @@ void UserInputHandler::handleAway(const BufferInfo &bufferInfo, const QString &m
 
   // if there is no message supplied we have to check if we are already away or not
   if(msg.isEmpty()) {
 
   // if there is no message supplied we have to check if we are already away or not
   if(msg.isEmpty()) {
-    if(me && !me->isAway())
+    if(me && !me->isAway()) {
       awayMsg = network()->identityPtr()->awayReason();
       awayMsg = network()->identityPtr()->awayReason();
+      if(awayMsg.isEmpty()) {
+       awayMsg = tr("away");
+      }
+    }
   }
   if(me)
     me->setAwayMessage(awayMsg);
   }
   if(me)
     me->setAwayMessage(awayMsg);