From e96d31302c05d10e3188fb60a8d897d88915b2cd Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Thu, 25 Nov 2021 16:16:05 -0800 Subject: [PATCH] Offset should apply to rownum not content hash --- peer/cwtchprofilestorage.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/peer/cwtchprofilestorage.go b/peer/cwtchprofilestorage.go index 9548924..5d46dc4 100644 --- a/peer/cwtchprofilestorage.go +++ b/peer/cwtchprofilestorage.go @@ -537,8 +537,7 @@ func (cps *CwtchProfileStorage) GetChannelMessageByContentHash(conversation int, } rows.Close() - // Return the offset **not** the count - return id - 1, nil + return id, nil } // GetRowNumberByMessageID looks up the row number of a message by the message ID @@ -575,8 +574,8 @@ func (cps *CwtchProfileStorage) GetRowNumberByMessageID(conversation int, channe return -1, err } rows.Close() - - return rownum, nil + // Return the offset **not** the count + return rownum - 1, nil } // GetChannelMessage looks up a channel message by conversation, channel and message id. On success it