especially the away status, current. Temporarily RPL_WHO output is completely disabled to not
spam the status buffer. We need to find a way to distinguish auto queries from user-generated ones...
Also made the networkmodel aware of away status changes in IrcUser.
connect(ircUser, SIGNAL(nickSet(QString)),
this, SLOT(setNick(QString)));
+ connect(ircUser, SIGNAL(awaySet(bool)),
+ this, SLOT(setAway(bool)));
}
QString IrcUserItem::nickName() const {
emit dataChanged(0);
}
+void IrcUserItem::setAway(bool away) {
+ Q_UNUSED(away);
+ emit dataChanged(0);
+}
+
/*****************************************
* NetworkModel
*****************************************/
virtual quint64 id() const;
virtual QVariant data(int column, int role) const;
virtual QString toolTip(int column) const;
-
+
private slots:
void setNick(QString newNick);
+ void setAway(bool);
private:
QPointer<IrcUser> _ircUser;
/* RPL_ENDOFWHO: "<name> :End of WHO list" */
void IrcServerHandler::handle315(const QString &prefix, const QList<QByteArray> ¶ms) {
Q_UNUSED(prefix)
- emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] %1").arg(serverDecode(params).join(" ")));
+ // FIXME temporarily made silent
+ Q_UNUSED(params)
+ // emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] %1").arg(serverDecode(params).join(" ")));
}
/* RPL_WHOISIDLE - "<nick> <integer> :seconds idle"
ircuser->setRealName(serverDecode(params.last()).section(" ", 1));
}
- emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] %1").arg(serverDecode(params).join(" ")));
+ // FIXME temporarily made silent
+ //emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] %1").arg(serverDecode(params).join(" ")));
}
/* RPL_NAMREPLY */
_autoReconnectCount(0)
{
_autoReconnectTimer.setSingleShot(true);
+
+ // TODO make configurable
+ _whoTimer.setInterval(60 * 1000);
+ _whoTimer.setSingleShot(false);
+
connect(&_autoReconnectTimer, SIGNAL(timeout()), this, SLOT(doAutoReconnect()));
+ connect(&_whoTimer, SIGNAL(timeout()), this, SLOT(sendWho()));
connect(network, SIGNAL(currentServerSet(const QString &)), this, SLOT(networkInitialized(const QString &)));
connect(network, SIGNAL(useAutoReconnectSet(bool)), this, SLOT(autoReconnectSettingsChanged()));
setConnectionState(Network::Initialized);
network()->setConnected(true);
emit connected(networkId());
-
+ sendWho();
+ _whoTimer.start();
}
void NetworkConnection::sendPerform() {
}
void NetworkConnection::socketDisconnected() {
+ _whoTimer.stop();
network()->setConnected(false);
emit disconnected(networkId());
if(_autoReconnectCount == 0) emit quitRequested(networkId());
putRawLine(msg);
}
+void NetworkConnection::sendWho() {
+ foreach(QString chan, network()->channels()) {
+ putRawLine("WHO " + serverEncode(chan));
+ }
+}
+
void NetworkConnection::addChannelKey(const QString &channel, const QString &key) {
if(key.isEmpty()) removeChannelKey(channel);
else _channelKeys[channel] = key;
void sendPerform();
void autoReconnectSettingsChanged();
void doAutoReconnect();
+ void sendWho();
void nickChanged(const QString &newNick, const QString &oldNick); // this signal is inteded to rename query buffers in the storage backend
signals:
Network *_network;
CoreSession *_coreSession;
+ BufferInfo _statusBufferInfo;
IrcServerHandler *_ircServerHandler;
UserInputHandler *_userInputHandler;
QTimer _autoReconnectTimer;
int _autoReconnectCount;
+ QTimer _whoTimer;
+
class ParseError : public Exception {
public:
ParseError(QString cmd, QString prefix, QStringList params);