X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fircuser.h;h=7ec878e71423753bf510d73c4b424f3db3eb0126;hp=00df169cd21f8a5141f39654e6cd188c5093cc7b;hb=3eebe11329417e77038d860af3b6f35630f40450;hpb=83e369bbb28a21f21dc939cce93189f98ca8502b diff --git a/src/common/ircuser.h b/src/common/ircuser.h index 00df169c..7ec878e7 100644 --- a/src/common/ircuser.h +++ b/src/common/ircuser.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _IRCUSER_H_ -#define _IRCUSER_H_ +#ifndef IRCUSER_H +#define IRCUSER_H #include #include @@ -28,12 +28,14 @@ #include #include "syncableobject.h" +#include "types.h" class SignalProxy; class Network; class IrcChannel; class IrcUser : public SyncableObject { + SYNCABLE_OBJECT Q_OBJECT Q_PROPERTY(QString user READ user WRITE setUser STORED false) @@ -88,6 +90,12 @@ public: QString decodeString(const QByteArray &text) const; QByteArray encodeString(const QString &string) const; + // only valid on client side, these are not synced! + inline QDateTime lastChannelActivity(BufferId id) const { return _lastActivity.value(id); } + void setLastChannelActivity(BufferId id, const QDateTime &time); + inline QDateTime lastSpokenTo(BufferId id) const { return _lastSpokenTo.value(id); } + void setLastSpokenTo(BufferId id, const QDateTime &time); + public slots: void setUser(const QString &user); void setHost(const QString &host); @@ -110,33 +118,36 @@ public slots: void joinChannel(const QString &channelname); void partChannel(IrcChannel *channel); void partChannel(const QString &channelname); + void quit(); void addUserModes(const QString &modes); void removeUserModes(const QString &modes); signals: - void userSet(QString user); - void hostSet(QString host); - void nickSet(QString newnick); - void realNameSet(QString realName); - void awaySet(bool away); - void awayMessageSet(QString awayMessage); - void idleTimeSet(QDateTime idleTime); - void loginTimeSet(QDateTime loginTime); - void serverSet(QString server); - void ircOperatorSet(QString ircOperator); - void lastAwayMessageSet(int lastAwayMessage); - void whoisServiceReplySet(QString whoisServiceReply); - void suserHostSet(QString suserHost); - void hostmaskUpdated(QString mask); +// void userSet(QString user); +// void hostSet(QString host); + void nickSet(QString newnick); // needed in NetworkModel +// void realNameSet(QString realName); + void awaySet(bool away); // needed in NetworkModel +// void awayMessageSet(QString awayMessage); +// void idleTimeSet(QDateTime idleTime); +// void loginTimeSet(QDateTime loginTime); +// void serverSet(QString server); +// void ircOperatorSet(QString ircOperator); +// void lastAwayMessageSet(int lastAwayMessage); +// void whoisServiceReplySet(QString whoisServiceReply); +// void suserHostSet(QString suserHost); void userModesSet(QString modes); + void userModesAdded(QString modes); + void userModesRemoved(QString modes); // void channelJoined(QString channel); void channelParted(QString channel); + void quited(); - void userModesAdded(QString modes); - void userModesRemoved(QString modes); + void lastChannelActivityUpdated(BufferId id, const QDateTime &newTime); + void lastSpokenToUpdated(BufferId id, const QDateTime &newTime); private slots: void updateObjectName(); @@ -176,6 +187,9 @@ private: QTextCodec *_codecForEncoding; QTextCodec *_codecForDecoding; + + QHash _lastActivity; + QHash _lastSpokenTo; }; #endif