_unlimitedReconnectRetries(false),
_codecForServer(0),
_codecForEncoding(0),
- _codecForDecoding(0)
+ _codecForDecoding(0),
+ _autoAwayActive(false)
{
setObjectName(QString::number(networkid.toInt()));
}
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef NETWORK_H_
-#define NETWORK_H_
+#ifndef NETWORK_H
+#define NETWORK_H
#include <QString>
#include <QStringList>
static void setDefaultCodecForEncoding(const QByteArray &name);
static void setDefaultCodecForDecoding(const QByteArray &name);
+ bool autoAwayActive() const { return _autoAwayActive; }
+ void setAutoAwayActive(bool active) { _autoAwayActive = active; }
+
public slots:
void setNetworkName(const QString &networkName);
void setCurrentServer(const QString ¤tServer);
static QTextCodec *_defaultCodecForServer;
static QTextCodec *_defaultCodecForEncoding;
static QTextCodec *_defaultCodecForDecoding;
+
+ bool _autoAwayActive; // when this is active handle305 and handle306 don't trigger any output
};
//! Stores all editable information about a network (as opposed to runtime state).
awayReason = identity->detachAwayReason();
else
awayReason = identity->awayReason();
+ network->setAutoAwayActive(true);
con->userInputHandler()->handleAway(BufferInfo(), awayReason);
}
}
if(me)
me->setAway(false);
- if(!params.isEmpty())
- emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", serverDecode(params[0]));
+ if(!network()->autoAwayActive()) {
+ if(!params.isEmpty())
+ emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", serverDecode(params[0]));
+ } else {
+ network()->setAutoAwayActive(false);
+ }
}
// 306 RPL_NOWAWAY
if(me)
me->setAway(true);
- if(!params.isEmpty())
+ if(!params.isEmpty() && !network()->autoAwayActive())
emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", serverDecode(params[0]));
}