+/***********************************************************************************************/
+// NotificationSettings:
+
+NotificationSettings::NotificationSettings() : ClientSettings("Notification") {
+}
+
+void NotificationSettings::setHighlightList(const QVariantList &highlightList) {
+ setLocalValue("Highlights/CustomList", highlightList);
+}
+
+QVariantList NotificationSettings::highlightList() {
+ return localValue("Highlights/CustomList").toList();
+}
+
+void NotificationSettings::setHighlightNick(NotificationSettings::HighlightNickType highlightNickType) {
+ setLocalValue("Highlights/HighlightNick", highlightNickType);
+}
+
+NotificationSettings::HighlightNickType NotificationSettings::highlightNick() {
+ return (NotificationSettings::HighlightNickType) localValue("Highlights/HighlightNick", CurrentNick).toInt();
+}
+
+void NotificationSettings::setNicksCaseSensitive(bool cs) {
+ setLocalValue("Highlights/NicksCaseSensitive", cs);
+}
+
+bool NotificationSettings::nicksCaseSensitive() {
+ return localValue("Highlights/NicksCaseSensitive", false).toBool();
+}
+
+
+// ========================================
+// KnownHostsSettings
+// ========================================
+KnownHostsSettings::KnownHostsSettings()
+ : ClientSettings("KnownHosts")
+{
+}
+
+QByteArray KnownHostsSettings::knownDigest(const QHostAddress &address) {
+ return localValue(address.toString(), QByteArray()).toByteArray();
+}
+
+void KnownHostsSettings::saveKnownHost(const QHostAddress &address, const QByteArray &certDigest) {
+ setLocalValue(address.toString(), certDigest);
+}
+
+bool KnownHostsSettings::isKnownHost(const QHostAddress &address, const QByteArray &certDigest) {
+ return certDigest == localValue(address.toString(), QByteArray()).toByteArray();
+}
+
+#ifdef HAVE_SSL
+QByteArray KnownHostsSettings::knownDigest(const QSslSocket *socket) {
+ return knownDigest(socket->peerAddress());
+}
+
+void KnownHostsSettings::saveKnownHost(const QSslSocket *socket) {
+ Q_ASSERT(socket);
+ saveKnownHost(socket->peerAddress(), socket->peerCertificate().digest());
+}
+
+bool KnownHostsSettings::isKnownHost(const QSslSocket *socket) {
+ Q_ASSERT(socket);
+ return isKnownHost(socket->peerAddress(), socket->peerCertificate().digest());
+}
+#endif