quassel-sasl.patch
src/common/network.cpp | ||
---|---|---|
47 | 47 |
_prefixModes(QString()), |
48 | 48 |
_useRandomServer(false), |
49 | 49 |
_useAutoIdentify(false), |
50 |
_useSasl(false), |
|
50 | 51 |
_useAutoReconnect(false), |
51 | 52 |
_autoReconnectInterval(60), |
52 | 53 |
_autoReconnectRetries(10), |
... | ... | |
87 | 88 |
info.useAutoIdentify = useAutoIdentify(); |
88 | 89 |
info.autoIdentifyService = autoIdentifyService(); |
89 | 90 |
info.autoIdentifyPassword = autoIdentifyPassword(); |
91 |
info.useSasl = useSasl(); |
|
92 |
info.saslAccount = saslAccount(); |
|
93 |
info.saslPassword = saslPassword(); |
|
90 | 94 |
info.useAutoReconnect = useAutoReconnect(); |
91 | 95 |
info.autoReconnectInterval = autoReconnectInterval(); |
92 | 96 |
info.autoReconnectRetries = autoReconnectRetries(); |
... | ... | |
108 | 112 |
if(info.useAutoIdentify != useAutoIdentify()) setUseAutoIdentify(info.useAutoIdentify); |
109 | 113 |
if(info.autoIdentifyService != autoIdentifyService()) setAutoIdentifyService(info.autoIdentifyService); |
110 | 114 |
if(info.autoIdentifyPassword != autoIdentifyPassword()) setAutoIdentifyPassword(info.autoIdentifyPassword); |
115 |
if(info.useSasl != useSasl()) setUseSasl(info.useSasl); |
|
116 |
if(info.saslAccount != saslAccount()) setSaslAccount(info.saslAccount); |
|
117 |
if(info.saslPassword != saslPassword()) setSaslPassword(info.saslPassword); |
|
111 | 118 |
if(info.useAutoReconnect != useAutoReconnect()) setUseAutoReconnect(info.useAutoReconnect); |
112 | 119 |
if(info.autoReconnectInterval != autoReconnectInterval()) setAutoReconnectInterval(info.autoReconnectInterval); |
113 | 120 |
if(info.autoReconnectRetries != autoReconnectRetries()) setAutoReconnectRetries(info.autoReconnectRetries); |
... | ... | |
566 | 573 |
emit configChanged(); |
567 | 574 |
} |
568 | 575 | |
576 |
void Network::setUseSasl(bool use) { |
|
577 |
_useSasl = use; |
|
578 |
SYNC(ARG(use)) |
|
579 |
emit configChanged(); |
|
580 |
} |
|
581 | ||
582 |
void Network::setSaslAccount(const QString &account) { |
|
583 |
_saslAccount = account; |
|
584 |
SYNC(ARG(account)) |
|
585 |
emit configChanged(); |
|
586 |
} |
|
587 | ||
588 |
void Network::setSaslPassword(const QString &password) { |
|
589 |
_saslPassword = password; |
|
590 |
SYNC(ARG(password)) |
|
591 |
emit configChanged(); |
|
592 |
} |
|
593 | ||
569 | 594 |
void Network::setUseAutoReconnect(bool use) { |
570 | 595 |
_useAutoReconnect = use; |
571 | 596 |
SYNC(ARG(use)) |
... | ... | |
758 | 783 |
useRandomServer(false), |
759 | 784 |
useAutoIdentify(false), |
760 | 785 |
autoIdentifyService("NickServ"), |
786 |
useSasl(false), |
|
761 | 787 |
useAutoReconnect(true), |
762 | 788 |
autoReconnectInterval(60), |
763 | 789 |
autoReconnectRetries(20), |
... | ... | |
780 | 806 |
if(useAutoIdentify != other.useAutoIdentify) return false; |
781 | 807 |
if(autoIdentifyService != other.autoIdentifyService) return false; |
782 | 808 |
if(autoIdentifyPassword != other.autoIdentifyPassword) return false; |
809 |
if(useSasl != other.useSasl) return false; |
|
810 |
if(saslAccount != other.saslAccount) return false; |
|
811 |
if(saslPassword != other.saslPassword) return false; |
|
783 | 812 |
if(useAutoReconnect != other.useAutoReconnect) return false; |
784 | 813 |
if(autoReconnectInterval != other.autoReconnectInterval) return false; |
785 | 814 |
if(autoReconnectRetries != other.autoReconnectRetries) return false; |
... | ... | |
806 | 835 |
i["UseAutoIdentify"] = info.useAutoIdentify; |
807 | 836 |
i["AutoIdentifyService"] = info.autoIdentifyService; |
808 | 837 |
i["AutoIdentifyPassword"] = info.autoIdentifyPassword; |
838 |
i["UseSasl"] = info.useSasl; |
|
839 |
i["SaslAccount"] = info.saslAccount; |
|
840 |
i["SaslPassword"] = info.saslPassword; |
|
809 | 841 |
i["UseAutoReconnect"] = info.useAutoReconnect; |
810 | 842 |
i["AutoReconnectInterval"] = info.autoReconnectInterval; |
811 | 843 |
i["AutoReconnectRetries"] = info.autoReconnectRetries; |
... | ... | |
830 | 862 |
info.useAutoIdentify = i["UseAutoIdentify"].toBool(); |
831 | 863 |
info.autoIdentifyService = i["AutoIdentifyService"].toString(); |
832 | 864 |
info.autoIdentifyPassword = i["AutoIdentifyPassword"].toString(); |
865 |
info.useSasl = i["UseSasl"].toBool(); |
|
866 |
info.saslAccount = i["SaslAccount"].toString(); |
|
867 |
info.saslPassword = i["SaslPassword"].toString(); |
|
833 | 868 |
info.useAutoReconnect = i["UseAutoReconnect"].toBool(); |
834 | 869 |
info.autoReconnectInterval = i["AutoReconnectInterval"].toUInt(); |
835 | 870 |
info.autoReconnectRetries = i["AutoReconnectRetries"].toInt(); |
... | ... | |
843 | 878 |
<< " codecForServer = " << i.codecForServer << " codecForEncoding = " << i.codecForEncoding << " codecForDecoding = " << i.codecForDecoding |
844 | 879 |
<< " serverList = " << i.serverList << " useRandomServer = " << i.useRandomServer << " perform = " << i.perform |
845 | 880 |
<< " useAutoIdentify = " << i.useAutoIdentify << " autoIdentifyService = " << i.autoIdentifyService << " autoIdentifyPassword = " << i.autoIdentifyPassword |
846 |
<< " useAutoReconnect = " << i.useAutoReconnect << " autoReconnectInterval = " << i.autoReconnectInterval |
|
881 |
<< " useSasl = " << i.useSasl << " saslAccount = " << i.saslAccount << " saslPassword = " << i.saslPassword |
|
882 |
<< " useAutoReconnect = " << i.useAutoReconnect << " autoReconnectInterval = " << i.autoReconnectInterval |
|
847 | 883 |
<< " autoReconnectRetries = " << i.autoReconnectRetries << " unlimitedReconnectRetries = " << i.unlimitedReconnectRetries |
848 | 884 |
<< " rejoinChannels = " << i.rejoinChannels << ")"; |
849 | 885 |
return dbg.space(); |
src/common/network.h | ||
---|---|---|
64 | 64 |
Q_PROPERTY(bool useAutoIdentify READ useAutoIdentify WRITE setUseAutoIdentify STORED false) |
65 | 65 |
Q_PROPERTY(QString autoIdentifyService READ autoIdentifyService WRITE setAutoIdentifyService STORED false) |
66 | 66 |
Q_PROPERTY(QString autoIdentifyPassword READ autoIdentifyPassword WRITE setAutoIdentifyPassword STORED false) |
67 |
Q_PROPERTY(bool useSasl READ useSasl WRITE setUseSasl STORED false) |
|
68 |
Q_PROPERTY(QString saslAccount READ saslAccount WRITE setSaslAccount STORED false) |
|
69 |
Q_PROPERTY(QString saslPassword READ saslPassword WRITE setSaslPassword STORED false) |
|
67 | 70 |
Q_PROPERTY(bool useAutoReconnect READ useAutoReconnect WRITE setUseAutoReconnect STORED false) |
68 | 71 |
Q_PROPERTY(quint32 autoReconnectInterval READ autoReconnectInterval WRITE setAutoReconnectInterval STORED false) |
69 | 72 |
Q_PROPERTY(quint16 autoReconnectRetries READ autoReconnectRetries WRITE setAutoReconnectRetries STORED false) |
... | ... | |
153 | 156 |
inline bool useAutoIdentify() const { return _useAutoIdentify; } |
154 | 157 |
inline const QString &autoIdentifyService() const { return _autoIdentifyService; } |
155 | 158 |
inline const QString &autoIdentifyPassword() const { return _autoIdentifyPassword; } |
159 |
inline bool useSasl() const { return _useSasl; } |
|
160 |
inline const QString &saslAccount() const { return _saslAccount; } |
|
161 |
inline const QString &saslPassword() const { return _saslPassword; } |
|
156 | 162 |
inline bool useAutoReconnect() const { return _useAutoReconnect; } |
157 | 163 |
inline quint32 autoReconnectInterval() const { return _autoReconnectInterval; } |
158 | 164 |
inline quint16 autoReconnectRetries() const { return _autoReconnectRetries; } |
... | ... | |
223 | 229 |
void setUseAutoIdentify(bool); |
224 | 230 |
void setAutoIdentifyService(const QString &); |
225 | 231 |
void setAutoIdentifyPassword(const QString &); |
232 |
void setUseSasl(bool); |
|
233 |
void setSaslAccount(const QString &); |
|
234 |
void setSaslPassword(const QString &); |
|
226 | 235 |
virtual void setUseAutoReconnect(bool); |
227 | 236 |
virtual void setAutoReconnectInterval(quint32); |
228 | 237 |
virtual void setAutoReconnectRetries(quint16); |
... | ... | |
339 | 348 |
QString _autoIdentifyService; |
340 | 349 |
QString _autoIdentifyPassword; |
341 | 350 | |
351 |
bool _useSasl; |
|
352 |
QString _saslAccount; |
|
353 |
QString _saslPassword; |
|
354 | ||
342 | 355 |
bool _useAutoReconnect; |
343 | 356 |
quint32 _autoReconnectInterval; |
344 | 357 |
quint16 _autoReconnectRetries; |
... | ... | |
386 | 399 |
QString autoIdentifyService; |
387 | 400 |
QString autoIdentifyPassword; |
388 | 401 | |
402 |
bool useSasl; |
|
403 |
QString saslAccount; |
|
404 |
QString saslPassword; |
|
405 | ||
389 | 406 |
bool useAutoReconnect; |
390 | 407 |
quint32 autoReconnectInterval; |
391 | 408 |
quint16 autoReconnectRetries; |
src/core/SQL/PostgreSQL/15/insert_network.sql | ||
---|---|---|
1 |
INSERT INTO network (userid, networkname, identityid, servercodec, encodingcodec, decodingcodec, userandomserver, perform, useautoidentify, autoidentifyservice, autoidentifypassword, useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries, rejoinchannels) |
|
2 |
VALUES (:userid, :networkname, :identityid, :servercodec, :encodingcodec, :decodingcodec, :userandomserver, :perform, :useautoidentify, :autoidentifyservice, :autoidentifypassword, :useautoreconnect, :autoreconnectinterval, :autoreconnectretries, :unlimitedconnectretries, :rejoinchannels) |
|
1 |
INSERT INTO network (userid, networkname, identityid, servercodec, encodingcodec, decodingcodec, userandomserver, perform, useautoidentify, autoidentifyservice, autoidentifypassword, useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries, rejoinchannels, usesasl, saslaccount, saslpassword)
|
|
2 |
VALUES (:userid, :networkname, :identityid, :servercodec, :encodingcodec, :decodingcodec, :userandomserver, :perform, :useautoidentify, :autoidentifyservice, :autoidentifypassword, :useautoreconnect, :autoreconnectinterval, :autoreconnectretries, :unlimitedconnectretries, :rejoinchannels, :usesasl, :saslaccount, :saslpassword)
|
|
3 | 3 |
RETURNING networkid |
src/core/SQL/PostgreSQL/15/select_networks_for_user.sql | ||
---|---|---|
1 | 1 |
SELECT networkid, networkname, identityid, servercodec, encodingcodec, decodingcodec, |
2 | 2 |
userandomserver, perform, useautoidentify, autoidentifyservice, autoidentifypassword, |
3 |
useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries, rejoinchannels |
|
3 |
useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries, rejoinchannels, |
|
4 |
usesasl, saslaccount, saslpassword |
|
4 | 5 |
FROM network |
5 |
WHERE userid = :userid |
|
6 |
WHERE userid = :userid |
src/core/SQL/PostgreSQL/15/setup_040_network.sql | ||
---|---|---|
11 | 11 |
useautoidentify boolean NOT NULL DEFAULT FALSE, |
12 | 12 |
autoidentifyservice varchar(128), |
13 | 13 |
autoidentifypassword varchar(128), |
14 |
usesasl boolean NOT NULL DEFAULT FALSE, |
|
15 |
saslaccount varchar(128), |
|
16 |
saslpassword varchar(128), |
|
14 | 17 |
useautoreconnect boolean NOT NULL DEFAULT TRUE, |
15 | 18 |
autoreconnectinterval integer NOT NULL DEFAULT 0, |
16 | 19 |
autoreconnectretries integer NOT NULL DEFAULT 0, |
src/core/SQL/PostgreSQL/15/update_network.sql | ||
---|---|---|
13 | 13 |
autoreconnectinterval = :autoreconnectinterval, |
14 | 14 |
autoreconnectretries = :autoreconnectretries, |
15 | 15 |
unlimitedconnectretries = :unlimitedconnectretries, |
16 |
rejoinchannels = :rejoinchannels |
|
16 |
rejoinchannels = :rejoinchannels, |
|
17 |
usesasl = :usesasl, |
|
18 |
saslaccount = :saslaccount, |
|
19 |
saslpassword = :saslpassword |
|
17 | 20 |
WHERE networkid = :networkid |
src/core/SQL/SQLite/16/insert_network.sql | ||
---|---|---|
1 | 1 |
INSERT INTO network (userid, networkname, identityid, servercodec, encodingcodec, decodingcodec, userandomserver, |
2 |
perform, useautoidentify, autoidentifyservice, autoidentifypassword, useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries, rejoinchannels) |
|
2 |
perform, useautoidentify, autoidentifyservice, autoidentifypassword, useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries, rejoinchannels, usesasl, saslaccount, saslpassword)
|
|
3 | 3 |
VALUES (:userid, :networkname, :identityid, :servercodec, :encodingcodec, :decodingcodec, :userandomserver, |
4 |
:perform, :useautoidentify, :autoidentifyservice, :autoidentifypassword, :useautoreconnect, :autoreconnectinterval, :autoreconnectretries, :unlimitedconnectretries, :rejoinchannels) |
|
4 |
:perform, :useautoidentify, :autoidentifyservice, :autoidentifypassword, :useautoreconnect, :autoreconnectinterval, :autoreconnectretries, :unlimitedconnectretries, :rejoinchannels, :usesasl, :saslaccount, :saslpassword) |
src/core/SQL/SQLite/16/select_networks_for_user.sql | ||
---|---|---|
1 | 1 |
SELECT networkid, networkname, identityid, servercodec, encodingcodec, decodingcodec, |
2 | 2 |
userandomserver, perform, useautoidentify, autoidentifyservice, autoidentifypassword, |
3 |
useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries, rejoinchannels |
|
3 |
useautoreconnect, autoreconnectinterval, autoreconnectretries, unlimitedconnectretries, rejoinchannels, |
|
4 |
usesasl, saslaccount, saslpassword |
|
4 | 5 |
FROM network |
5 |
WHERE userid = :userid |
|
6 |
WHERE userid = :userid |
src/core/SQL/SQLite/16/setup_020_network.sql | ||
---|---|---|
11 | 11 |
useautoidentify INTEGER NOT NULL DEFAULT 0, -- BOOL |
12 | 12 |
autoidentifyservice TEXT, |
13 | 13 |
autoidentifypassword TEXT, |
14 |
usesasl INTEGER NOT NULL DEFAULT 0, -- BOOL |
|
15 |
saslaccount TEXT, |
|
16 |
saslpassword TEXT, |
|
14 | 17 |
useautoreconnect INTEGER NOT NULL DEFAULT 0, -- BOOL |
15 | 18 |
autoreconnectinterval INTEGER NOT NULL DEFAULT 0, |
16 | 19 |
autoreconnectretries INTEGER NOT NULL DEFAULT 0, |
src/core/SQL/SQLite/16/update_network.sql | ||
---|---|---|
13 | 13 |
autoreconnectinterval = :autoreconnectinterval, |
14 | 14 |
autoreconnectretries = :autoreconnectretries, |
15 | 15 |
unlimitedconnectretries = :unlimitedconnectretries, |
16 |
rejoinchannels = :rejoinchannels |
|
16 |
rejoinchannels = :rejoinchannels, |
|
17 |
usesasl = :usesasl, |
|
18 |
saslaccount = :saslaccount, |
|
19 |
saslpassword = :saslpassword |
|
17 | 20 |
WHERE networkid = :networkid AND userid = :userid |
src/core/SQL/SQLite/7/upgrade_010_create_newnetworktable.sql | ||
---|---|---|
11 | 11 |
useautoidentify INTEGER NOT NULL DEFAULT 0, -- BOOL |
12 | 12 |
autoidentifyservice TEXT, |
13 | 13 |
autoidentifypassword TEXT, |
14 |
usesasl INTEGER NOT NULL DEFAULT 0, --BOOL |
|
15 |
saslaccount TEXT, |
|
16 |
saslpassword TEXT, |
|
14 | 17 |
useautoreconnect INTEGER NOT NULL DEFAULT 0, -- BOOL |
15 | 18 |
autoreconnectinterval INTEGER NOT NULL DEFAULT 0, |
16 | 19 |
autoreconnectretries INTEGER NOT NULL DEFAULT 0, |
src/core/corenetwork.cpp | ||
---|---|---|
333 | 333 |
_tokenBucket = _burstSize; // init with a full bucket |
334 | 334 |
_tokenBucketTimer.start(_messageDelay); |
335 | 335 | |
336 |
if(networkInfo().useSasl) { |
|
337 |
putRawLine(serverEncode(QString("CAP REQ :sasl"))); |
|
338 |
} |
|
336 | 339 |
if(!server.password.isEmpty()) { |
337 | 340 |
putRawLine(serverEncode(QString("PASS %1").arg(server.password))); |
338 | 341 |
} |
src/core/ircserverhandler.cpp | ||
---|---|---|
84 | 84 | |
85 | 85 |
QString foo = serverDecode(params.takeFirst()); |
86 | 86 | |
87 |
// with SASL, the command is 'AUTHENTICATE +' and we should check for this here. |
|
88 |
if(foo == QString("AUTHENTICATE +")) { |
|
89 |
handleAuthenticate(); |
|
90 |
return; |
|
91 |
} |
|
92 | ||
87 | 93 |
// a colon as the first chars indicates the existence of a prefix |
88 | 94 |
if(foo[0] == ':') { |
89 | 95 |
foo.remove(0, 1); |
... | ... | |
160 | 166 |
case 321: case 366: case 376: |
161 | 167 |
break; |
162 | 168 | |
169 |
case 903: case 904: case 905: case 906: case 907: |
|
170 |
{ |
|
171 |
network()->putRawLine("CAP END"); |
|
172 |
emit displayMsg(Message::Info, BufferInfo::StatusBuffer, "", "CAP: " + params.join("")); |
|
173 |
} |
|
163 | 174 |
// Everything else will be marked in red, so we can add them somewhere. |
164 | 175 |
default: |
165 | 176 |
if(_whois) { |
... | ... | |
542 | 553 |
emit displayMsg(Message::Topic, BufferInfo::ChannelBuffer, channel->name(), tr("%1 has changed topic for %2 to: \"%3\"").arg(ircuser->nick()).arg(channel->name()).arg(topic)); |
543 | 554 |
} |
544 | 555 | |
556 |
void IrcServerHandler::handleCap(const QString &prefix, const QList<QByteArray> ¶ms) { |
|
557 |
// for SASL, there will only be a single param of 'sasl', however you can check here for |
|
558 |
// additional CAP messages (ls, multi-prefix, et cetera). |
|
559 | ||
560 |
Q_UNUSED(prefix); |
|
561 | ||
562 |
if(params.size() == 3) { |
|
563 |
QString param = serverDecode(params[2]); |
|
564 |
if(param == QString("sasl")) { // SASL Ready |
|
565 |
network()->putRawLine(serverEncode("AUTHENTICATE PLAIN")); // Only working with PLAIN atm, blowfish later |
|
566 |
} |
|
567 |
} |
|
568 |
} |
|
569 | ||
570 |
void IrcServerHandler::handleAuthenticate() { |
|
571 |
QString construct = network()->saslAccount(); |
|
572 |
construct.append(QChar(QChar::Null)); |
|
573 |
construct.append(network()->saslAccount()); |
|
574 |
construct.append(QChar(QChar::Null)); |
|
575 |
construct.append(network()->saslPassword()); |
|
576 |
QByteArray saslData = QByteArray(construct.toAscii().toBase64()); |
|
577 |
saslData.prepend(QString("AUTHENTICATE ").toAscii()); |
|
578 |
network()->putRawLine(saslData); |
|
579 |
} |
|
580 | ||
545 | 581 |
/* RPL_WELCOME */ |
546 | 582 |
void IrcServerHandler::handle001(const QString &prefix, const QList<QByteArray> ¶ms) { |
547 | 583 |
network()->setCurrentServer(prefix); |
src/core/ircserverhandler.h | ||
---|---|---|
45 | 45 |
void handlePrivmsg(const QString &prefix, const QList<QByteArray> ¶ms); |
46 | 46 |
void handleQuit(const QString &prefix, const QList<QByteArray> ¶ms); |
47 | 47 |
void handleTopic(const QString &prefix, const QList<QByteArray> ¶ms); |
48 | ||
48 |
void handleCap(const QString &prefix, const QList<QByteArray> ¶ms); // CAP framework |
|
49 |
void handleAuthenticate(); // SASL auth - no params |
|
49 | 50 |
void handle001(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_WELCOME |
50 | 51 |
void handle005(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_ISUPPORT |
51 | 52 |
void handle221(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_UMODEIS |
... | ... | |
78 | 79 |
void handle353(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_NAMREPLY |
79 | 80 |
void handle369(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_ENDOFWHOWAS |
80 | 81 |
void handle432(const QString &prefix, const QList<QByteArray> ¶ms); // ERR_ERRONEUSNICKNAME |
81 |
void handle433(const QString &prefix, const QList<QByteArray> ¶ms); // ERR_NICKNAMEINUSE
|
|
82 |
void handle433(const QString &prefix, const QList<QByteArray> ¶ms); // ERR_NICKNAMEINUS |
|
82 | 83 | |
83 | 84 |
void defaultHandler(QString cmd, const QString &prefix, const QList<QByteArray> ¶ms); |
84 | 85 |
src/core/sqlitestorage.cpp | ||
---|---|---|
591 | 591 |
query.bindValue(":useautoidentify", info.useAutoIdentify ? 1 : 0); |
592 | 592 |
query.bindValue(":autoidentifyservice", info.autoIdentifyService); |
593 | 593 |
query.bindValue(":autoidentifypassword", info.autoIdentifyPassword); |
594 |
query.bindValue(":usesasl", info.useSasl ? 1 : 0); |
|
595 |
query.bindValue(":saslaccount", info.saslAccount); |
|
596 |
query.bindValue(":saslpassword", info.saslPassword); |
|
594 | 597 |
query.bindValue(":useautoreconnect", info.useAutoReconnect ? 1 : 0); |
595 | 598 |
query.bindValue(":autoreconnectinterval", info.autoReconnectInterval); |
596 | 599 |
query.bindValue(":autoreconnectretries", info.autoReconnectRetries); |
... | ... | |
780 | 783 |
net.autoReconnectRetries = networksQuery.value(13).toInt(); |
781 | 784 |
net.unlimitedReconnectRetries = networksQuery.value(14).toInt() == 1 ? true : false; |
782 | 785 |
net.rejoinChannels = networksQuery.value(15).toInt() == 1 ? true : false; |
786 |
net.useSasl = networksQuery.value(16).toInt() == 1 ? true : false; |
|
787 |
net.saslAccount = networksQuery.value(17).toString(); |
|
788 |
net.saslPassword = networksQuery.value(18).toString(); |
|
783 | 789 | |
784 | 790 |
serversQuery.bindValue(":networkid", net.networkId.toInt()); |
785 | 791 |
safeExec(serversQuery); |
src/qtui/settingspages/networkssettingspage.cpp | ||
---|---|---|
78 | 78 |
connect(ui.autoIdentify, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged())); |
79 | 79 |
connect(ui.autoIdentifyService, SIGNAL(textEdited(const QString &)), this, SLOT(widgetHasChanged())); |
80 | 80 |
connect(ui.autoIdentifyPassword, SIGNAL(textEdited(const QString &)), this, SLOT(widgetHasChanged())); |
81 |
connect(ui.sasl, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged())); |
|
82 |
connect(ui.saslAccount, SIGNAL(textEdited(QString)), this, SLOT(widgetHasChanged())); |
|
83 |
connect(ui.saslPassword, SIGNAL(textEdited(QString)), this, SLOT(widgetHasChanged())); |
|
81 | 84 |
connect(ui.useCustomEncodings, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged())); |
82 | 85 |
connect(ui.sendEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged())); |
83 | 86 |
connect(ui.recvEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged())); |
... | ... | |
429 | 432 |
ui.autoIdentify->setChecked(info.useAutoIdentify); |
430 | 433 |
ui.autoIdentifyService->setText(info.autoIdentifyService); |
431 | 434 |
ui.autoIdentifyPassword->setText(info.autoIdentifyPassword); |
435 |
ui.sasl->setChecked(info.useSasl); |
|
436 |
ui.saslAccount->setText(info.saslAccount); |
|
437 |
ui.saslPassword->setText(info.saslPassword); |
|
432 | 438 |
if(info.codecForEncoding.isEmpty()) { |
433 | 439 |
ui.sendEncoding->setCurrentIndex(ui.sendEncoding->findText(Network::defaultCodecForEncoding())); |
434 | 440 |
ui.recvEncoding->setCurrentIndex(ui.recvEncoding->findText(Network::defaultCodecForDecoding())); |
... | ... | |
452 | 458 |
ui.performEdit->clear(); |
453 | 459 |
ui.autoIdentifyService->clear(); |
454 | 460 |
ui.autoIdentifyPassword->clear(); |
461 |
ui.saslAccount->clear(); |
|
462 |
ui.saslPassword->clear(); |
|
455 | 463 |
setWidgetStates(); |
456 | 464 |
} |
457 | 465 |
_ignoreWidgetChanges = false; |
... | ... | |
465 | 473 |
info.useAutoIdentify = ui.autoIdentify->isChecked(); |
466 | 474 |
info.autoIdentifyService = ui.autoIdentifyService->text(); |
467 | 475 |
info.autoIdentifyPassword = ui.autoIdentifyPassword->text(); |
476 |
info.useSasl = ui.sasl->isChecked(); |
|
477 |
info.saslAccount = ui.saslAccount->text(); |
|
478 |
info.saslPassword = ui.saslPassword->text(); |
|
468 | 479 |
if(!ui.useCustomEncodings->isChecked()) { |
469 | 480 |
info.codecForEncoding.clear(); |
470 | 481 |
info.codecForDecoding.clear(); |
src/qtui/settingspages/networkssettingspage.ui | ||
---|---|---|
7 | 7 |
<x>0</x> |
8 | 8 |
<y>0</y> |
9 | 9 |
<width>515</width> |
10 |
<height>453</height>
|
|
10 |
<height>503</height>
|
|
11 | 11 |
</rect> |
12 | 12 |
</property> |
13 | 13 |
<property name="windowTitle"> |
... | ... | |
548 | 548 |
</widget> |
549 | 549 |
</item> |
550 | 550 |
<item> |
551 |
<widget class="QGroupBox" name="sasl"> |
|
552 |
<property name="enabled"> |
|
553 |
<bool>true</bool> |
|
554 |
</property> |
|
555 |
<property name="title"> |
|
556 |
<string>Use SASL Authentication</string> |
|
557 |
</property> |
|
558 |
<property name="checkable"> |
|
559 |
<bool>true</bool> |
|
560 |
</property> |
|
561 |
<property name="checked"> |
|
562 |
<bool>true</bool> |
|
563 |
</property> |
|
564 |
<layout class="QGridLayout" name="gridLayout_2"> |
|
565 |
<item row="0" column="1"> |
|
566 |
<widget class="QLineEdit" name="saslAccount"> |
|
567 |
<property name="enabled"> |
|
568 |
<bool>true</bool> |
|
569 |
</property> |
|
570 |
<property name="text"> |
|
571 |
<string/> |
|
572 |
</property> |
|
573 |
</widget> |
|
574 |
</item> |
|
575 |
<item row="1" column="1"> |
|
576 |
<widget class="QLineEdit" name="saslPassword"> |
|
577 |
<property name="enabled"> |
|
578 |
<bool>true</bool> |
|
579 |
</property> |
|
580 |
<property name="echoMode"> |
|
581 |
<enum>QLineEdit::Password</enum> |
|
582 |
</property> |
|
583 |
</widget> |
|
584 |
</item> |
|
585 |
<item row="1" column="0"> |
|
586 |
<widget class="QLabel" name="label_11"> |
|
587 |
<property name="enabled"> |
|
588 |
<bool>true</bool> |
|
589 |
</property> |
|
590 |
<property name="text"> |
|
591 |
<string>Password:</string> |
|
592 |
</property> |
|
593 |
</widget> |
|
594 |
</item> |
|
595 |
<item row="0" column="0"> |
|
596 |
<widget class="QLabel" name="label_10"> |
|
597 |
<property name="enabled"> |
|
598 |
<bool>true</bool> |
|
599 |
</property> |
|
600 |
<property name="text"> |
|
601 |
<string>Account:</string> |
|
602 |
</property> |
|
603 |
</widget> |
|
604 |
</item> |
|
605 |
</layout> |
|
606 |
</widget> |
|
607 |
</item> |
|
608 |
<item> |
|
551 | 609 |
<spacer name="verticalSpacer_2"> |
552 | 610 |
<property name="orientation"> |
553 | 611 |
<enum>Qt::Vertical</enum> |
... | ... | |
718 | 776 |
<tabstop>reconnectRetries</tabstop> |
719 | 777 |
<tabstop>unlimitedRetries</tabstop> |
720 | 778 |
<tabstop>rejoinOnReconnect</tabstop> |
721 |
<tabstop>autoIdentify</tabstop> |
|
722 | 779 |
<tabstop>autoIdentifyService</tabstop> |
723 | 780 |
<tabstop>autoIdentifyPassword</tabstop> |
724 | 781 |
<tabstop>useCustomEncodings</tabstop> |
... | ... | |
735 | 792 |
<slot>setDisabled(bool)</slot> |
736 | 793 |
<hints> |
737 | 794 |
<hint type="sourcelabel"> |
738 |
<x>173</x>
|
|
739 |
<y>296</y>
|
|
795 |
<x>317</x>
|
|
796 |
<y>331</y>
|
|
740 | 797 |
</hint> |
741 | 798 |
<hint type="destinationlabel"> |
742 |
<x>118</x>
|
|
743 |
<y>294</y>
|
|
799 |
<x>209</x>
|
|
800 |
<y>334</y>
|
|
744 | 801 |
</hint> |
745 | 802 |
</hints> |
746 | 803 |
</connection> |