+// ====================
+// PUBLIC:
+// ====================
+
+QString IrcUser::hostmask() const {
+ return QString("%1!%2@%3").arg(nick()).arg(user()).arg(host());
+}
+
+QDateTime IrcUser::idleTime() {
+ if(QDateTime::currentDateTime().toTime_t() - _idleTimeSet.toTime_t() > 1200)
+ _idleTime = QDateTime();
+ return _idleTime;
+}
+
+QStringList IrcUser::channels() const {
+ QStringList chanList;
+ IrcChannel *channel;
+ foreach(channel, _channels) {
+ chanList << channel->name();
+ }
+ return chanList;
+}
+
+
+void IrcUser::setCodecForEncoding(const QString &name) {
+ setCodecForEncoding(QTextCodec::codecForName(name.toAscii()));
+}
+
+void IrcUser::setCodecForEncoding(QTextCodec *codec) {
+ _codecForEncoding = codec;
+}
+
+void IrcUser::setCodecForDecoding(const QString &name) {
+ setCodecForDecoding(QTextCodec::codecForName(name.toAscii()));
+}
+
+void IrcUser::setCodecForDecoding(QTextCodec *codec) {
+ _codecForDecoding = codec;
+}
+
+QString IrcUser::decodeString(const QByteArray &text) const {
+ if(!codecForDecoding()) return network()->decodeString(text);
+ return ::decodeString(text, codecForDecoding());
+}
+
+QByteArray IrcUser::encodeString(const QString &string) const {
+ if(codecForEncoding()) {
+ return codecForEncoding()->fromUnicode(string);
+ }
+ return network()->encodeString(string);
+}
+
+// ====================
+// PUBLIC SLOTS:
+// ====================