Merge pull request 'Offset should apply to rownum not content hash' (#405) from p2p-interim-new-storage into master
continuous-integration/drone/push Build is failing Details

Reviewed-on: #405
This commit is contained in:
Dan Ballard 2021-11-26 00:18:16 +00:00
commit da788b9c1d
1 changed files with 3 additions and 4 deletions

View File

@ -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