- IrcUser(const QString &hostmask, NetworkInfo *networkInfo);
- virtual ~IrcUser();
-
- bool initialized() const;
-
- QString user() const;
- QString host() const;
- QString nick() const;
- QString hostmask() const;
-
- QString userModes() const;
-
- QStringList channels() const;
-
- // user-specific encodings
- QTextCodec *codecForEncoding() const;
- QTextCodec *codecForDecoding() const;
- void setCodecForEncoding(const QString &codecName);
- void setCodecForEncoding(QTextCodec *codec);
- void setCodecForDecoding(const QString &codecName);
- void setCodecForDecoding(QTextCodec *codec);
-
- QString decodeString(const QByteArray &text) const;
- QByteArray encodeString(const QString string) const;
+ IrcUser(const QString& hostmask, Network* network);
+
+ inline QString user() const { return _user; }
+ inline QString host() const { return _host; }
+ inline QString nick() const { return _nick; }
+ inline QString realName() const { return _realName; }
+ /**
+ * Account name, e.g. NickServ/SASL account
+ *
+ * @return Account name if logged in, * if logged out, or empty string if unknown
+ */
+ inline QString account() const { return _account; }
+ QString hostmask() const;
+ inline bool isAway() const { return _away; }
+ inline QString awayMessage() const { return _awayMessage; }
+ QDateTime idleTime();
+ inline QDateTime loginTime() const { return _loginTime; }
+ inline QString server() const { return _server; }
+ inline QString ircOperator() const { return _ircOperator; }
+ inline QDateTime lastAwayMessageTime() const { return _lastAwayMessageTime; }
+ inline QString whoisServiceReply() const { return _whoisServiceReply; }
+ inline QString suserHost() const { return _suserHost; }
+ inline bool encrypted() const { return _encrypted; }
+ inline Network* network() const { return _network; }
+
+ inline QString userModes() const { return _userModes; }
+
+ QStringList channels() const;
+
+ // user-specific encodings
+ inline QTextCodec* codecForEncoding() const { return _codecForEncoding; }
+ inline QTextCodec* codecForDecoding() const { return _codecForDecoding; }
+ void setCodecForEncoding(const QString& codecName);
+ void setCodecForEncoding(QTextCodec* codec);
+ void setCodecForDecoding(const QString& codecName);
+ void setCodecForDecoding(QTextCodec* codec);
+
+ 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);
+
+ /**
+ * Gets whether or not the away state has changed since it was last acknowledged
+ *
+ * Away state is marked as changed by any modification to away status (away/here, message)
+ *
+ * NOTE: On servers lacking support for IRCv3 away-notify, this won't update until an autoWHO-
+ * run for away/here changes, or until sending a message to the user for away message changes.
+ *
+ * @see IrcUser::acknowledgeAwayChanged()
+ *
+ * @return True if current away state is unchanged from last acknowledgement, otherwise false
+ */
+ inline bool hasAwayChanged() const { return _awayChanged; }
+
+ /**
+ * Sets the last away state change as acknowledged
+ *
+ * @see IrcUser::hasAwayChanged()
+ */
+ inline void acknowledgeAwayChanged()
+ {
+ // Don't sync this as individual clients may suppress different kinds of behaviors
+ _awayChanged = false;
+ }