adding tons of ifdefs so quassel will build again without ssl support
[quassel.git] / src / core / sqlitestorage.cpp
index a418d05..392459b 100644 (file)
@@ -214,8 +214,14 @@ IdentityId SqliteStorage::createIdentity(UserId user, CoreIdentity &identity) {
   query.bindValue(":kickreason", identity.kickReason());
   query.bindValue(":partreason", identity.partReason());
   query.bindValue(":quitreason", identity.quitReason());
   query.bindValue(":kickreason", identity.kickReason());
   query.bindValue(":partreason", identity.partReason());
   query.bindValue(":quitreason", identity.quitReason());
+#ifdef HAVE_SSL
   query.bindValue(":sslcert", identity.sslCert().toPem());
   query.bindValue(":sslkey", identity.sslKey().toPem());
   query.bindValue(":sslcert", identity.sslCert().toPem());
   query.bindValue(":sslkey", identity.sslKey().toPem());
+#else
+  query.bindValue(":sslcert", QByteArray());
+  query.bindValue(":sslkey", QByteArray());
+#endif
+
   safeExec(query);
 
   identityId = query.lastInsertId().toInt();
   safeExec(query);
 
   identityId = query.lastInsertId().toInt();
@@ -269,8 +275,13 @@ bool SqliteStorage::updateIdentity(UserId user, const CoreIdentity &identity) {
   query.bindValue(":kickreason", identity.kickReason());
   query.bindValue(":partreason", identity.partReason());
   query.bindValue(":quitreason", identity.quitReason());
   query.bindValue(":kickreason", identity.kickReason());
   query.bindValue(":partreason", identity.partReason());
   query.bindValue(":quitreason", identity.quitReason());
+#ifdef HAVE_SSL
   query.bindValue(":sslcert", identity.sslCert().toPem());
   query.bindValue(":sslkey", identity.sslKey().toPem());
   query.bindValue(":sslcert", identity.sslCert().toPem());
   query.bindValue(":sslkey", identity.sslKey().toPem());
+#else
+  query.bindValue(":sslcert", QByteArray());
+  query.bindValue(":sslkey", QByteArray());
+#endif
   query.bindValue(":identityid", identity.id().toInt());
   safeExec(query);
 
   query.bindValue(":identityid", identity.id().toInt());
   safeExec(query);
 
@@ -344,8 +355,10 @@ QList<CoreIdentity> SqliteStorage::identities(UserId user) {
     identity.setKickReason(query.value(15).toString());
     identity.setPartReason(query.value(16).toString());
     identity.setQuitReason(query.value(17).toString());
     identity.setKickReason(query.value(15).toString());
     identity.setPartReason(query.value(16).toString());
     identity.setQuitReason(query.value(17).toString());
+#ifdef HAVE_SSL
     identity.setSslCert(query.value(18).toByteArray());
     identity.setSslKey(query.value(19).toByteArray());
     identity.setSslCert(query.value(18).toByteArray());
     identity.setSslKey(query.value(19).toByteArray());
+#endif
 
     nickQuery.bindValue(":identityid", identity.id().toInt());
     QList<QString> nicks;
 
     nickQuery.bindValue(":identityid", identity.id().toInt());
     QList<QString> nicks;