enforce usage of SQLite in Monolithic mode
[quassel.git] / src / core / core.cpp
index 0b34f29..378e3a4 100644 (file)
 #  include <termios.h>
 #endif /* Q_OS_WIN32 */
 
-#include <sys/types.h>
-#include <sys/stat.h>
+// umask
+#ifndef Q_OS_WIN32
+#  include <sys/types.h>
+#  include <sys/stat.h>
+#endif /* Q_OS_WIN32 */
 
 // ==============================
 //  Custom Events
@@ -77,7 +80,9 @@ void Core::destroy() {
 Core::Core()
   : _storage(0)
 {
+#ifndef Q_OS_WIN32
   umask(S_IRWXG | S_IRWXO);
+#endif /* Q_OS_WIN32 */
   _startTime = QDateTime::currentDateTime().toUTC();  // for uptime :)
 
   Quassel::loadTranslation(QLocale::system());
@@ -257,7 +262,7 @@ QString Core::setupCoreForInternalUsage() {
   }
   setupData["AdminUser"] = "AdminUser";
   setupData["AdminPasswd"] = QString::number(pass);
-  setupData["Backend"] = _storageBackends[_storageBackends.keys().first()]->displayName();
+  setupData["Backend"] = QString("SQLite"); // mono client currently needs sqlite
   return setupCore(setupData);
 }
 
@@ -533,6 +538,8 @@ void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) {
                                                      .arg(Quassel::buildInfo().buildDate)
       .arg(updays).arg(uphours,2,10,QChar('0')).arg(upmins,2,10,QChar('0')).arg(startTime().toString(Qt::TextDate));
 
+    reply["CoreFeatures"] = (int)Quassel::features();
+
 #ifdef HAVE_SSL
     SslServer *sslServer = qobject_cast<SslServer *>(&_server);
     QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
@@ -868,7 +875,7 @@ void Core::createUser() {
     return;
   }
 
-  if(_storage->addUser(username, password).isValid()) {
+  if(_configured && _storage->addUser(username, password).isValid()) {
     out << "Added user " << username << " successfully!" << endl;
   } else {
     qWarning() << "Unable to add user:" << qPrintable(username);
@@ -906,7 +913,7 @@ void Core::changeUserPass(const QString &username) {
     return;
   }
 
-  if(_storage->updateUser(userId, password)) {
+  if(_configured && _storage->updateUser(userId, password)) {
     out << "Password changed successfuly!" << endl;
   } else {
     qWarning() << "Failed to change password!";