1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
27 QTextCodec *Network::_defaultCodecForServer = 0;
28 QTextCodec *Network::_defaultCodecForEncoding = 0;
29 QTextCodec *Network::_defaultCodecForDecoding = 0;
31 Network::Server Network::Server::fromVariant(const QVariant &variant) {
32 QVariantMap serverMap = variant.toMap();
33 return Server(serverMap["Host"].toString(), serverMap["Port"].toUInt(), serverMap["Password"].toString(), serverMap["UseSSL"].toBool());
36 QVariant Network::Server::toVariant() const {
37 QVariantMap serverMap;
38 serverMap["Host"] = host;
39 serverMap["Port"] = port;
40 serverMap["Password"] = password;
41 serverMap["UseSSL"] = useSsl;
42 return QVariant::fromValue<QVariantMap>(serverMap);
45 // ====================
47 // ====================
48 Network::Network(const NetworkId &networkid, QObject *parent)
49 : SyncableObject(parent),
51 _networkId(networkid),
55 _networkName(QString("<not initialized>")),
56 _currentServer(QString()),
58 _connectionState(Disconnected),
60 _prefixModes(QString()),
61 _useRandomServer(false),
62 _useAutoIdentify(false),
63 _useAutoReconnect(false),
64 _autoReconnectInterval(60),
65 _autoReconnectRetries(10),
66 _unlimitedReconnectRetries(false),
70 _autoAwayActive(false)
72 setObjectName(QString::number(networkid.toInt()));
76 emit aboutToBeDestroyed();
79 bool Network::isChannelName(const QString &channelname) const {
80 if(channelname.isEmpty())
83 if(supports("CHANTYPES"))
84 return support("CHANTYPES").contains(channelname[0]);
86 return QString("#&!+").contains(channelname[0]);
89 NetworkInfo Network::networkInfo() const {
91 info.networkName = networkName();
92 info.networkId = networkId();
93 info.identity = identity();
94 info.codecForServer = codecForServer();
95 info.codecForEncoding = codecForEncoding();
96 info.codecForDecoding = codecForDecoding();
97 info.serverList = variantServerList();
98 info.useRandomServer = useRandomServer();
99 info.perform = perform();
100 info.useAutoIdentify = useAutoIdentify();
101 info.autoIdentifyService = autoIdentifyService();
102 info.autoIdentifyPassword = autoIdentifyPassword();
103 info.useAutoReconnect = useAutoReconnect();
104 info.autoReconnectInterval = autoReconnectInterval();
105 info.autoReconnectRetries = autoReconnectRetries();
106 info.unlimitedReconnectRetries = unlimitedReconnectRetries();
107 info.rejoinChannels = rejoinChannels();
111 void Network::setNetworkInfo(const NetworkInfo &info) {
112 // we don't set our ID!
113 if(!info.networkName.isEmpty() && info.networkName != networkName()) setNetworkName(info.networkName);
114 if(info.identity > 0 && info.identity != identity()) setIdentity(info.identity);
115 if(info.codecForServer != codecForServer()) setCodecForServer(QTextCodec::codecForName(info.codecForServer));
116 if(info.codecForEncoding != codecForEncoding()) setCodecForEncoding(QTextCodec::codecForName(info.codecForEncoding));
117 if(info.codecForDecoding != codecForDecoding()) setCodecForDecoding(QTextCodec::codecForName(info.codecForDecoding));
118 if(info.serverList.count()) setServerList(info.serverList); // FIXME compare components
119 if(info.useRandomServer != useRandomServer()) setUseRandomServer(info.useRandomServer);
120 if(info.perform != perform()) setPerform(info.perform);
121 if(info.useAutoIdentify != useAutoIdentify()) setUseAutoIdentify(info.useAutoIdentify);
122 if(info.autoIdentifyService != autoIdentifyService()) setAutoIdentifyService(info.autoIdentifyService);
123 if(info.autoIdentifyPassword != autoIdentifyPassword()) setAutoIdentifyPassword(info.autoIdentifyPassword);
124 if(info.useAutoReconnect != useAutoReconnect()) setUseAutoReconnect(info.useAutoReconnect);
125 if(info.autoReconnectInterval != autoReconnectInterval()) setAutoReconnectInterval(info.autoReconnectInterval);
126 if(info.autoReconnectRetries != autoReconnectRetries()) setAutoReconnectRetries(info.autoReconnectRetries);
127 if(info.unlimitedReconnectRetries != unlimitedReconnectRetries()) setUnlimitedReconnectRetries(info.unlimitedReconnectRetries);
128 if(info.rejoinChannels != rejoinChannels()) setRejoinChannels(info.rejoinChannels);
131 QString Network::prefixToMode(const QString &prefix) {
132 if(prefixes().contains(prefix))
133 return QString(prefixModes()[prefixes().indexOf(prefix)]);
138 QString Network::modeToPrefix(const QString &mode) {
139 if(prefixModes().contains(mode))
140 return QString(prefixes()[prefixModes().indexOf(mode)]);
145 QStringList Network::nicks() const {
146 // we don't use _ircUsers.keys() since the keys may be
147 // not up to date after a nick change
149 foreach(IrcUser *ircuser, _ircUsers.values()) {
150 nicks << ircuser->nick();
155 QVariantList Network::variantServerList() const {
156 QVariantList servers;
157 ServerList::const_iterator serverIter = _serverList.constBegin();
158 while(serverIter != _serverList.constEnd()) {
159 servers << serverIter->toVariant();
165 QString Network::prefixes() {
166 if(_prefixes.isNull())
172 QString Network::prefixModes() {
173 if(_prefixModes.isNull())
179 // example Unreal IRCD: CHANMODES=beI,kfL,lj,psmntirRcOAQKVCuzNSMTG
180 Network::ChannelModeType Network::channelModeType(const QString &mode) {
182 return NOT_A_CHANMODE;
184 QString chanmodes = support("CHANMODES");
185 if(chanmodes.isEmpty())
186 return NOT_A_CHANMODE;
188 ChannelModeType modeType = A_CHANMODE;
189 for(int i = 0; i < chanmodes.count(); i++) {
190 if(chanmodes[i] == mode[0])
192 else if(chanmodes[i] == ',')
193 modeType = (ChannelModeType)(modeType << 1);
195 if(modeType > D_CHANMODE) {
196 qWarning() << "Network" << networkId() << "supplied invalid CHANMODES:" << chanmodes;
197 modeType = NOT_A_CHANMODE;
202 QString Network::support(const QString ¶m) const {
203 QString support_ = param.toUpper();
204 if(_supports.contains(support_))
205 return _supports[support_];
210 IrcUser *Network::newIrcUser(const QString &hostmask, const QVariantMap &initData) {
211 QString nick(nickFromMask(hostmask).toLower());
212 if(!_ircUsers.contains(nick)) {
213 IrcUser *ircuser = new IrcUser(hostmask, this);
214 if(!initData.isEmpty()) {
215 ircuser->fromVariantMap(initData);
216 ircuser->setInitialized();
220 proxy()->synchronize(ircuser);
222 qWarning() << "unable to synchronize new IrcUser" << hostmask << "forgot to call Network::setProxy(SignalProxy *)?";
224 connect(ircuser, SIGNAL(nickSet(QString)), this, SLOT(ircUserNickChanged(QString)));
226 _ircUsers[nick] = ircuser;
228 emit ircUserAdded(hostmask);
229 emit ircUserAdded(ircuser);
232 return _ircUsers[nick];
235 IrcUser *Network::ircUser(QString nickname) const {
236 nickname = nickname.toLower();
237 if(_ircUsers.contains(nickname))
238 return _ircUsers[nickname];
243 void Network::removeIrcUser(IrcUser *ircuser) {
244 QString nick = _ircUsers.key(ircuser);
248 _ircUsers.remove(nick);
249 disconnect(ircuser, 0, this, 0);
250 ircuser->deleteLater();
253 void Network::removeIrcChannel(IrcChannel *channel) {
254 QString chanName = _ircChannels.key(channel);
255 if(chanName.isNull())
258 _ircChannels.remove(chanName);
259 disconnect(channel, 0, this, 0);
260 channel->deleteLater();
263 void Network::removeChansAndUsers() {
264 QList<IrcUser *> users = ircUsers();
266 QList<IrcChannel *> channels = ircChannels();
267 _ircChannels.clear();
269 foreach(IrcChannel *channel, channels) {
270 proxy()->detachObject(channel);
271 disconnect(channel, 0, this, 0);
273 foreach(IrcUser *user, users) {
274 proxy()->detachObject(user);
275 disconnect(user, 0, this, 0);
278 // the second loop is needed because quit can have sideffects
279 foreach(IrcUser *user, users) {
284 qDeleteAll(channels);
287 IrcChannel *Network::newIrcChannel(const QString &channelname, const QVariantMap &initData) {
288 if(!_ircChannels.contains(channelname.toLower())) {
289 IrcChannel *channel = ircChannelFactory(channelname);
290 if(!initData.isEmpty()) {
291 channel->fromVariantMap(initData);
292 channel->setInitialized();
296 proxy()->synchronize(channel);
298 qWarning() << "unable to synchronize new IrcChannel" << channelname << "forgot to call Network::setProxy(SignalProxy *)?";
300 _ircChannels[channelname.toLower()] = channel;
302 emit ircChannelAdded(channelname);
303 emit ircChannelAdded(channel);
305 return _ircChannels[channelname.toLower()];
308 IrcChannel *Network::ircChannel(QString channelname) const {
309 channelname = channelname.toLower();
310 if(_ircChannels.contains(channelname))
311 return _ircChannels[channelname];
316 QByteArray Network::defaultCodecForServer() {
317 if(_defaultCodecForServer)
318 return _defaultCodecForServer->name();
322 void Network::setDefaultCodecForServer(const QByteArray &name) {
323 _defaultCodecForServer = QTextCodec::codecForName(name);
326 QByteArray Network::defaultCodecForEncoding() {
327 if(_defaultCodecForEncoding)
328 return _defaultCodecForEncoding->name();
332 void Network::setDefaultCodecForEncoding(const QByteArray &name) {
333 _defaultCodecForEncoding = QTextCodec::codecForName(name);
336 QByteArray Network::defaultCodecForDecoding() {
337 if(_defaultCodecForDecoding)
338 return _defaultCodecForDecoding->name();
342 void Network::setDefaultCodecForDecoding(const QByteArray &name) {
343 _defaultCodecForDecoding = QTextCodec::codecForName(name);
346 QByteArray Network::codecForServer() const {
348 return _codecForServer->name();
352 void Network::setCodecForServer(const QByteArray &name) {
353 setCodecForServer(QTextCodec::codecForName(name));
356 void Network::setCodecForServer(QTextCodec *codec) {
357 _codecForServer = codec;
358 emit codecForServerSet(codecForServer());
361 QByteArray Network::codecForEncoding() const {
362 if(_codecForEncoding)
363 return _codecForEncoding->name();
367 void Network::setCodecForEncoding(const QByteArray &name) {
368 setCodecForEncoding(QTextCodec::codecForName(name));
371 void Network::setCodecForEncoding(QTextCodec *codec) {
372 _codecForEncoding = codec;
373 emit codecForEncodingSet(codecForEncoding());
376 QByteArray Network::codecForDecoding() const {
377 if(_codecForDecoding)
378 return _codecForDecoding->name();
379 else return QByteArray();
382 void Network::setCodecForDecoding(const QByteArray &name) {
383 setCodecForDecoding(QTextCodec::codecForName(name));
386 void Network::setCodecForDecoding(QTextCodec *codec) {
387 _codecForDecoding = codec;
388 emit codecForDecodingSet(codecForDecoding());
391 // FIXME use server encoding if appropriate
392 QString Network::decodeString(const QByteArray &text) const {
393 if(_codecForDecoding)
394 return ::decodeString(text, _codecForDecoding);
395 else return ::decodeString(text, _defaultCodecForDecoding);
398 QByteArray Network::encodeString(const QString &string) const {
399 if(_codecForEncoding) {
400 return _codecForEncoding->fromUnicode(string);
402 if(_defaultCodecForEncoding) {
403 return _defaultCodecForEncoding->fromUnicode(string);
405 return string.toAscii();
408 QString Network::decodeServerString(const QByteArray &text) const {
410 return ::decodeString(text, _codecForServer);
412 return ::decodeString(text, _defaultCodecForServer);
415 QByteArray Network::encodeServerString(const QString &string) const {
416 if(_codecForServer) {
417 return _codecForServer->fromUnicode(string);
419 if(_defaultCodecForServer) {
420 return _defaultCodecForServer->fromUnicode(string);
422 return string.toAscii();
425 // ====================
427 // ====================
428 void Network::setNetworkName(const QString &networkName) {
429 _networkName = networkName;
430 emit networkNameSet(networkName);
433 void Network::setCurrentServer(const QString ¤tServer) {
434 _currentServer = currentServer;
435 emit currentServerSet(currentServer);
438 void Network::setConnected(bool connected) {
439 if(_connected == connected)
442 _connected = connected;
444 setMyNick(QString());
445 setCurrentServer(QString());
446 removeChansAndUsers();
448 emit connectedSet(connected);
451 //void Network::setConnectionState(ConnectionState state) {
452 void Network::setConnectionState(int state) {
453 _connectionState = (ConnectionState)state;
454 //qDebug() << "netstate" << networkId() << networkName() << state;
455 emit connectionStateSet(state);
456 emit connectionStateSet(_connectionState);
459 void Network::setMyNick(const QString &nickname) {
461 if(!_myNick.isEmpty() && !ircUser(myNick())) {
462 newIrcUser(myNick());
464 emit myNickSet(nickname);
467 void Network::setLatency(int latency) {
468 if(_latency == latency)
471 emit latencySet(latency);
474 void Network::setIdentity(IdentityId id) {
476 emit identitySet(id);
479 void Network::setServerList(const QVariantList &serverList) {
481 foreach(QVariant variant, serverList) {
482 _serverList << Server::fromVariant(variant);
484 emit serverListSet(serverList);
487 void Network::setUseRandomServer(bool use) {
488 _useRandomServer = use;
489 emit useRandomServerSet(use);
492 void Network::setPerform(const QStringList &perform) {
494 emit performSet(perform);
497 void Network::setUseAutoIdentify(bool use) {
498 _useAutoIdentify = use;
499 emit useAutoIdentifySet(use);
502 void Network::setAutoIdentifyService(const QString &service) {
503 _autoIdentifyService = service;
504 emit autoIdentifyServiceSet(service);
507 void Network::setAutoIdentifyPassword(const QString &password) {
508 _autoIdentifyPassword = password;
509 emit autoIdentifyPasswordSet(password);
512 void Network::setUseAutoReconnect(bool use) {
513 _useAutoReconnect = use;
514 emit useAutoReconnectSet(use);
517 void Network::setAutoReconnectInterval(quint32 interval) {
518 _autoReconnectInterval = interval;
519 emit autoReconnectIntervalSet(interval);
522 void Network::setAutoReconnectRetries(quint16 retries) {
523 _autoReconnectRetries = retries;
524 emit autoReconnectRetriesSet(retries);
527 void Network::setUnlimitedReconnectRetries(bool unlimited) {
528 _unlimitedReconnectRetries = unlimited;
529 emit unlimitedReconnectRetriesSet(unlimited);
532 void Network::setRejoinChannels(bool rejoin) {
533 _rejoinChannels = rejoin;
534 emit rejoinChannelsSet(rejoin);
537 void Network::addSupport(const QString ¶m, const QString &value) {
538 if(!_supports.contains(param)) {
539 _supports[param] = value;
540 emit supportAdded(param, value);
544 void Network::removeSupport(const QString ¶m) {
545 if(_supports.contains(param)) {
546 _supports.remove(param);
547 emit supportRemoved(param);
551 QVariantMap Network::initSupports() const {
552 QVariantMap supports;
553 QHashIterator<QString, QString> iter(_supports);
554 while(iter.hasNext()) {
556 supports[iter.key()] = iter.value();
561 QVariantMap Network::initIrcUsersAndChannels() const {
562 QVariantMap usersAndChannels;
564 QVariantMap channels;
566 QHash<QString, IrcUser *>::const_iterator userIter = _ircUsers.constBegin();
567 QHash<QString, IrcUser *>::const_iterator userIterEnd = _ircUsers.constEnd();
568 while(userIter != userIterEnd) {
569 users[userIter.value()->hostmask()] = userIter.value()->toVariantMap();
572 usersAndChannels["users"] = users;
574 QHash<QString, IrcChannel *>::const_iterator channelIter = _ircChannels.constBegin();
575 QHash<QString, IrcChannel *>::const_iterator channelIterEnd = _ircChannels.constEnd();
576 while(channelIter != channelIterEnd) {
577 channels[channelIter.value()->name()] = channelIter.value()->toVariantMap();
580 usersAndChannels["channels"] = channels;
582 return usersAndChannels;
585 void Network::initSetIrcUsersAndChannels(const QVariantMap &usersAndChannels) {
587 if(isInitialized()) {
588 qWarning() << "Network" << networkId() << "received init data for users and channels allthough there allready are known users or channels!";
592 QVariantMap users = usersAndChannels.value("users").toMap();
593 QVariantMap::const_iterator userIter = users.constBegin();
594 QVariantMap::const_iterator userIterEnd = users.constEnd();
595 while(userIter != userIterEnd) {
596 newIrcUser(userIter.key(), userIter.value().toMap());
600 QVariantMap channels = usersAndChannels.value("channels").toMap();
601 QVariantMap::const_iterator channelIter = channels.constBegin();
602 QVariantMap::const_iterator channelIterEnd = channels.constEnd();
603 while(channelIter != channelIterEnd) {
604 newIrcChannel(channelIter.key(), channelIter.value().toMap());
609 void Network::initSetSupports(const QVariantMap &supports) {
610 QMapIterator<QString, QVariant> iter(supports);
611 while(iter.hasNext()) {
613 addSupport(iter.key(), iter.value().toString());
617 void Network::initSetServerList(const QVariantList &serverList) {
618 foreach(QVariant variant, serverList) {
619 _serverList << Server::fromVariant(variant);
623 IrcUser *Network::updateNickFromMask(const QString &mask) {
624 QString nick(nickFromMask(mask).toLower());
627 if(_ircUsers.contains(nick)) {
628 ircuser = _ircUsers[nick];
629 ircuser->updateHostmask(mask);
631 ircuser = newIrcUser(mask);
636 void Network::ircUserNickChanged(QString newnick) {
637 QString oldnick = _ircUsers.key(qobject_cast<IrcUser*>(sender()));
642 if(newnick.toLower() != oldnick) _ircUsers[newnick.toLower()] = _ircUsers.take(oldnick);
644 if(myNick().toLower() == oldnick)
648 void Network::emitConnectionError(const QString &errorMsg) {
649 emit connectionError(errorMsg);
652 // ====================
654 // ====================
655 void Network::determinePrefixes() {
656 // seems like we have to construct them first
657 QString prefix = support("PREFIX");
659 if(prefix.startsWith("(") && prefix.contains(")")) {
660 _prefixes = prefix.section(")", 1);
661 _prefixModes = prefix.mid(1).section(")", 0, 0);
663 QString defaultPrefixes("~&@%+");
664 QString defaultPrefixModes("qaohv");
666 if(prefix.isEmpty()) {
667 _prefixes = defaultPrefixes;
668 _prefixModes = defaultPrefixModes;
672 // we just assume that in PREFIX are only prefix chars stored
673 for(int i = 0; i < defaultPrefixes.size(); i++) {
674 if(prefix.contains(defaultPrefixes[i])) {
675 _prefixes += defaultPrefixes[i];
676 _prefixModes += defaultPrefixModes[i];
680 if(!_prefixes.isNull())
683 // well... our assumption was obviously wrong...
684 // check if it's only prefix modes
685 for(int i = 0; i < defaultPrefixes.size(); i++) {
686 if(prefix.contains(defaultPrefixModes[i])) {
687 _prefixes += defaultPrefixes[i];
688 _prefixModes += defaultPrefixModes[i];
691 // now we've done all we've could...
695 /************************************************************************
697 ************************************************************************/
699 bool NetworkInfo::operator==(const NetworkInfo &other) const {
700 if(networkId != other.networkId) return false;
701 if(networkName != other.networkName) return false;
702 if(identity != other.identity) return false;
703 if(codecForServer != other.codecForServer) return false;
704 if(codecForEncoding != other.codecForEncoding) return false;
705 if(codecForDecoding != other.codecForDecoding) return false;
706 if(serverList != other.serverList) return false;
707 if(useRandomServer != other.useRandomServer) return false;
708 if(perform != other.perform) return false;
709 if(useAutoIdentify != other.useAutoIdentify) return false;
710 if(autoIdentifyService != other.autoIdentifyService) return false;
711 if(autoIdentifyPassword != other.autoIdentifyPassword) return false;
712 if(useAutoReconnect != other.useAutoReconnect) return false;
713 if(autoReconnectInterval != other.autoReconnectInterval) return false;
714 if(autoReconnectRetries != other.autoReconnectRetries) return false;
715 if(unlimitedReconnectRetries != other.unlimitedReconnectRetries) return false;
716 if(rejoinChannels != other.rejoinChannels) return false;
720 bool NetworkInfo::operator!=(const NetworkInfo &other) const {
721 return !(*this == other);
724 QDataStream &operator<<(QDataStream &out, const NetworkInfo &info) {
726 i["NetworkId"] = QVariant::fromValue<NetworkId>(info.networkId);
727 i["NetworkName"] = info.networkName;
728 i["Identity"] = QVariant::fromValue<IdentityId>(info.identity);
729 i["CodecForServer"] = info.codecForServer;
730 i["CodecForEncoding"] = info.codecForEncoding;
731 i["CodecForDecoding"] = info.codecForDecoding;
732 i["ServerList"] = info.serverList;
733 i["UseRandomServer"] = info.useRandomServer;
734 i["Perform"] = info.perform;
735 i["UseAutoIdentify"] = info.useAutoIdentify;
736 i["AutoIdentifyService"] = info.autoIdentifyService;
737 i["AutoIdentifyPassword"] = info.autoIdentifyPassword;
738 i["UseAutoReconnect"] = info.useAutoReconnect;
739 i["AutoReconnectInterval"] = info.autoReconnectInterval;
740 i["AutoReconnectRetries"] = info.autoReconnectRetries;
741 i["UnlimitedReconnectRetries"] = info.unlimitedReconnectRetries;
742 i["RejoinChannels"] = info.rejoinChannels;
747 QDataStream &operator>>(QDataStream &in, NetworkInfo &info) {
750 info.networkId = i["NetworkId"].value<NetworkId>();
751 info.networkName = i["NetworkName"].toString();
752 info.identity = i["Identity"].value<IdentityId>();
753 info.codecForServer = i["CodecForServer"].toByteArray();
754 info.codecForEncoding = i["CodecForEncoding"].toByteArray();
755 info.codecForDecoding = i["CodecForDecoding"].toByteArray();
756 info.serverList = i["ServerList"].toList();
757 info.useRandomServer = i["UseRandomServer"].toBool();
758 info.perform = i["Perform"].toStringList();
759 info.useAutoIdentify = i["UseAutoIdentify"].toBool();
760 info.autoIdentifyService = i["AutoIdentifyService"].toString();
761 info.autoIdentifyPassword = i["AutoIdentifyPassword"].toString();
762 info.useAutoReconnect = i["UseAutoReconnect"].toBool();
763 info.autoReconnectInterval = i["AutoReconnectInterval"].toUInt();
764 info.autoReconnectRetries = i["AutoReconnectRetries"].toInt();
765 info.unlimitedReconnectRetries = i["UnlimitedReconnectRetries"].toBool();
766 info.rejoinChannels = i["RejoinChannels"].toBool();
770 QDebug operator<<(QDebug dbg, const NetworkInfo &i) {
771 dbg.nospace() << "(id = " << i.networkId << " name = " << i.networkName << " identity = " << i.identity
772 << " codecForServer = " << i.codecForServer << " codecForEncoding = " << i.codecForEncoding << " codecForDecoding = " << i.codecForDecoding
773 << " serverList = " << i.serverList << " useRandomServer = " << i.useRandomServer << " perform = " << i.perform
774 << " useAutoIdentify = " << i.useAutoIdentify << " autoIdentifyService = " << i.autoIdentifyService << " autoIdentifyPassword = " << i.autoIdentifyPassword
775 << " useAutoReconnect = " << i.useAutoReconnect << " autoReconnectInterval = " << i.autoReconnectInterval
776 << " autoReconnectRetries = " << i.autoReconnectRetries << " unlimitedReconnectRetries = " << i.unlimitedReconnectRetries
777 << " rejoinChannels = " << i.rejoinChannels << ")";