Add documentation, clean up whitespace
authorShane Synan <digitalcircuit36939@gmail.com>
Sun, 5 Mar 2017 04:57:51 +0000 (22:57 -0600)
committerShane Synan <digitalcircuit36939@gmail.com>
Sun, 5 Mar 2017 05:18:03 +0000 (23:18 -0600)
Maintain tabs in .sql files, remove extra newline.

Add documentation to the setLastMsg function.

This helps maintain consistency with the other files.

src/core/SQL/PostgreSQL/20/setup_050_buffer.sql
src/core/SQL/SQLite/21/setup_030_buffer.sql
src/core/SQL/SQLite/21/upgrade_006_alter_table_buffer_new_rename_to_buffer.sql
src/core/postgresqlstorage.h
src/core/sqlitestorage.h

index a6665b5..a9206ac 100644 (file)
@@ -6,7 +6,7 @@ create TABLE buffer (
        buffername varchar(128) NOT NULL,
        buffercname varchar(128) NOT NULL, -- CANONICAL BUFFER NAME (lowercase version)
        buffertype integer NOT NULL DEFAULT 0,
-        lastmsgid integer NOT NULL DEFAULT 0,
+       lastmsgid integer NOT NULL DEFAULT 0,
        lastseenmsgid integer NOT NULL DEFAULT 0,
        markerlinemsgid integer NOT NULL DEFAULT 0,
        key varchar(128),
index 53ea542..952e20d 100644 (file)
@@ -6,7 +6,7 @@ CREATE TABLE buffer (
        buffername TEXT NOT NULL,
        buffercname TEXT NOT NULL, -- CANONICAL BUFFER NAME (lowercase version)
        buffertype INTEGER NOT NULL DEFAULT 0,
-        lastmsgid INTEGER NOT NULL DEFAULT 0,
+       lastmsgid INTEGER NOT NULL DEFAULT 0,
        lastseenmsgid INTEGER NOT NULL DEFAULT 0,
        markerlinemsgid INTEGER NOT NULL DEFAULT 0,
        key TEXT,
index 062aa0a..bffdb0d 100644 (file)
@@ -95,6 +95,17 @@ public slots:
     virtual QHash<BufferId, MsgId> bufferLastSeenMsgIds(UserId user);
     virtual void setBufferMarkerLineMsg(UserId user, const BufferId &bufferId, const MsgId &msgId);
     virtual QHash<BufferId, MsgId> bufferMarkerLineMsgIds(UserId user);
+    /**
+     * Sets the last known valid message ID for the given buffer.
+     *
+     * This limits LastSeenMsgIds from being set to message IDs in the future, improving performance
+     * when searching for messages in the backlog.
+     *
+     * @see PostgreSqlStorage::setBufferLastSeenMsg()
+     *
+     * @param bufferId[in] ID of the Buffer
+     * @param msgId[in]    ID of latest message for this buffer
+     */
     virtual void setBufferLastMsg(const BufferId &bufferId, const MsgId &msgId);
 
     /* Message handling */
index f66e70f..e42feb4 100644 (file)
@@ -96,6 +96,17 @@ public slots:
     virtual QHash<BufferId, MsgId> bufferLastSeenMsgIds(UserId user);
     virtual void setBufferMarkerLineMsg(UserId user, const BufferId &bufferId, const MsgId &msgId);
     virtual QHash<BufferId, MsgId> bufferMarkerLineMsgIds(UserId user);
+    /**
+     * Sets the last known valid message ID for the given buffer.
+     *
+     * This limits LastSeenMsgIds from being set to message IDs in the future, improving performance
+     * when searching for messages in the backlog.
+     *
+     * @see SqliteStorage::setBufferLastSeenMsg()
+     *
+     * @param bufferId[in] ID of the Buffer
+     * @param msgId[in]    ID of latest message for this buffer
+     */
     virtual void setBufferLastMsg(const BufferId &bufferId, const MsgId &msgId);
 
     /* Message handling */