Skip to content

Commit

Permalink
feat(lib): revert one method
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-suwala committed Oct 17, 2023
1 parent 66de710 commit d77c67c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 19 additions & 0 deletions lib/src/entities/membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ export class Membership {
return this.custom?.lastReadMessageTimetoken
}

async setLastReadMessage(message: Message) {
try {
const response = await this.update({
custom: { ...this.custom, lastReadMessageTimetoken: message.timetoken },
})

await this.chat.emitEvent({
channel: this.channel.id,
type: "receipt",
method: "signal",
payload: { messageTimetoken: message.timetoken },
})

return response
} catch (error) {
throw error
}
}

async setLastReadMessageTimetoken(timetoken: string) {
try {
const response = await this.update({
Expand Down
1 change: 0 additions & 1 deletion lib/src/entities/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export class User {
}

get active() {
console.log("userid", this.id, new Date().getTime(), this.lastActiveTimestamp)
return !!(
this.lastActiveTimestamp &&
new Date().getTime() - this.lastActiveTimestamp <= this.chat.config.storeUserActivityInterval
Expand Down

0 comments on commit d77c67c

Please sign in to comment.