X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fsqlitestorage.h;h=a710b630eafd4088b14bf02e3473dc011b83a739;hb=ef1ee865c342a16daab514a99110f56150ea95e7;hp=253d3eab7e32798dc9dd8db428d1223f1a58246c;hpb=5b560ec1a01349562ac58051ca7e7fa899d4b994;p=quassel.git diff --git a/src/core/sqlitestorage.h b/src/core/sqlitestorage.h index 253d3eab..a710b630 100644 --- a/src/core/sqlitestorage.h +++ b/src/core/sqlitestorage.h @@ -56,10 +56,22 @@ public slots: virtual bool updateNetwork(UserId user, const NetworkInfo &info); virtual bool removeNetwork(UserId user, const NetworkId &networkId); virtual QList networks(UserId user); + virtual QList connectedNetworks(UserId user); + virtual void setNetworkConnected(UserId user, const NetworkId &networkId, bool isConnected); + + /* persistent channels */ + virtual QHash persistentChannels(UserId user, const NetworkId &networkId); + virtual void setChannelPersistent(UserId user, const NetworkId &networkId, const QString &channel, bool isJoined); + virtual void setPersistentChannelKey(UserId user, const NetworkId &networkId, const QString &channel, const QString &key); /* Buffer handling */ virtual BufferInfo getBufferInfo(UserId user, const NetworkId &networkId, BufferInfo::Type type, const QString &buffer = ""); + virtual BufferInfo getBufferInfo(UserId user, const BufferId &bufferId); virtual QList requestBuffers(UserId user, QDateTime since = QDateTime()); + virtual bool removeBuffer(const UserId &user, const BufferId &bufferId); + virtual BufferId renameBuffer(const UserId &user, const NetworkId &networkId, const QString &newName, const QString &oldName); + virtual void setBufferLastSeen(UserId user, const BufferId &bufferId, const QDateTime &seenDate); + virtual QHash bufferLastSeenDates(UserId user); /* Message handling */ @@ -72,10 +84,13 @@ protected: inline virtual QString driverName() { return "QSQLITE"; } inline virtual QString databaseName() { return backlogFile(); } virtual int installedSchemaVersion(); + + virtual bool init(const QVariantMap &settings = QVariantMap()); // only needed for migration private: static QString backlogFile(); bool isValidNetwork(UserId user, const NetworkId &networkId); + bool isValidBuffer(const UserId &user, const BufferId &bufferId); NetworkId getNetworkId(UserId user, const QString &network); void createBuffer(UserId user, const NetworkId &networkId, BufferInfo::Type type, const QString &buffer); };