-void IrcUser::joinChannel(IrcChannel *channel) {
- Q_ASSERT(channel);
- if(!_channels.contains(channel)) {
- _channels.insert(channel);
- channel->join(this);
- connect(channel, SIGNAL(destroyed()), this, SLOT(channelDestroyed()));
- emit channelJoined(channel->name());
- }
+
+void IrcUser::setWhoisServiceReply(const QString &whoisServiceReply)
+{
+ if (!whoisServiceReply.isEmpty() && whoisServiceReply != _whoisServiceReply) {
+ _whoisServiceReply = whoisServiceReply;
+ SYNC(ARG(whoisServiceReply))
+ }
+}
+
+
+void IrcUser::setSuserHost(const QString &suserHost)
+{
+ if (!suserHost.isEmpty() && suserHost != _suserHost) {
+ _suserHost = suserHost;
+ SYNC(ARG(suserHost))
+ }
+}
+
+
+void IrcUser::setEncrypted(bool encrypted)
+{
+ _encrypted = encrypted;
+ emit encryptedSet(encrypted);
+ SYNC(ARG(encrypted))
+}
+
+
+void IrcUser::updateObjectName()
+{
+ renameObject(QString::number(network()->networkId().toInt()) + "/" + _nick);
+}
+
+
+void IrcUser::updateHostmask(const QString &mask)
+{
+ if (mask == hostmask())
+ return;
+
+ QString user = userFromMask(mask);
+ QString host = hostFromMask(mask);
+ setUser(user);
+ setHost(host);
+}
+
+
+void IrcUser::joinChannel(IrcChannel *channel)
+{
+ Q_ASSERT(channel);
+ if (!_channels.contains(channel)) {
+ _channels.insert(channel);
+ channel->joinIrcUser(this);
+ }
+}
+
+
+void IrcUser::joinChannel(const QString &channelname)
+{
+ joinChannel(network()->newIrcChannel(channelname));