query.bindValue(":useautoidentify", info.useAutoIdentify ? 1 : 0);
query.bindValue(":autoidentifyservice", info.autoIdentifyService);
query.bindValue(":autoidentifypassword", info.autoIdentifyPassword);
+ query.bindValue(":usesasl", info.useSasl ? 1 : 0);
+ query.bindValue(":saslaccount", info.saslAccount);
+ query.bindValue(":saslpassword", info.saslPassword);
query.bindValue(":useautoreconnect", info.useAutoReconnect ? 1 : 0);
query.bindValue(":autoreconnectinterval", info.autoReconnectInterval);
query.bindValue(":autoreconnectretries", info.autoReconnectRetries);
net.autoReconnectRetries = networksQuery.value(13).toInt();
net.unlimitedReconnectRetries = networksQuery.value(14).toInt() == 1 ? true : false;
net.rejoinChannels = networksQuery.value(15).toInt() == 1 ? true : false;
+ net.useSasl = networksQuery.value(16).toInt() == 1 ? true : false;
+ net.saslAccount = networksQuery.value(17).toString();
+ net.saslPassword = networksQuery.value(18).toString();
serversQuery.bindValue(":networkid", net.networkId.toInt());
safeExec(serversQuery);
createQuery.bindValue(":buffertype", (int)type);
createQuery.bindValue(":buffername", buffer);
createQuery.bindValue(":buffercname", buffer.toLower());
+ createQuery.bindValue(":joined", type & BufferInfo::ChannelBuffer ? 1 : 0);
unlock();
lockForWrite();
return lastSeenHash;
}
+void SqliteStorage::setBufferMarkerLineMsg(UserId user, const BufferId &bufferId, const MsgId &msgId) {
+ QSqlDatabase db = logDb();
+ db.transaction();
+
+ {
+ QSqlQuery query(db);
+ query.prepare(queryString("update_buffer_markerlinemsgid"));
+ query.bindValue(":userid", user.toInt());
+ query.bindValue(":bufferid", bufferId.toInt());
+ query.bindValue(":markerlinemsgid", msgId.toInt());
+
+ lockForWrite();
+ safeExec(query);
+ watchQuery(query);
+ }
+ db.commit();
+ unlock();
+}
+
+QHash<BufferId, MsgId> SqliteStorage::bufferMarkerLineMsgIds(UserId user) {
+ QHash<BufferId, MsgId> markerLineHash;
+
+ QSqlDatabase db = logDb();
+ db.transaction();
+
+ bool error = false;
+ {
+ QSqlQuery query(db);
+ query.prepare(queryString("select_buffer_markerlinemsgids"));
+ query.bindValue(":userid", user.toInt());
+
+ lockForRead();
+ safeExec(query);
+ error = !watchQuery(query);
+ if(!error) {
+ while(query.next()) {
+ markerLineHash[query.value(0).toInt()] = query.value(1).toInt();
+ }
+ }
+ }
+
+ db.commit();
+ unlock();
+ return markerLineHash;
+}
+
bool SqliteStorage::logMessage(Message &msg) {
QSqlDatabase db = logDb();
db.transaction();
network.awaymessage = value(19).toString();
network.attachperform = value(20).toString();
network.detachperform = value(21).toString();
+ network.usesasl = value(22).toInt() == 1 ? true : false;
+ network.saslaccount = value(23).toString();
+ network.saslpassword = value(24).toString();
return true;
}
buffer.buffercname = value(5).toString();
buffer.buffertype = value(6).toInt();
buffer.lastseenmsgid = value(7).toInt();
+ buffer.markerlinemsgid = value(8).toInt();
buffer.key = value(8).toString();
buffer.joined = value(9).toInt() == 1 ? true : false;
return true;