Offset should apply to rownum not content hash
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2021-11-25 16:16:05 -08:00
parent bc8a13b707
commit e96d31302c
1 changed files with 3 additions and 4 deletions

View File

@ -537,8 +537,7 @@ func (cps *CwtchProfileStorage) GetChannelMessageByContentHash(conversation int,
} }
rows.Close() rows.Close()
// Return the offset **not** the count return id, nil
return id - 1, nil
} }
// GetRowNumberByMessageID looks up the row number of a message by the message ID // 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 return -1, err
} }
rows.Close() rows.Close()
// Return the offset **not** the count
return rownum, nil return rownum - 1, nil
} }
// GetChannelMessage looks up a channel message by conversation, channel and message id. On success it // GetChannelMessage looks up a channel message by conversation, channel and message id. On success it