Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache last sent msgs #520

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Cache last sent msgs #520

merged 1 commit into from
Apr 3, 2023

Conversation

hloeung
Copy link
Collaborator

@hloeung hloeung commented Dec 9, 2022

Mainly useful for seeing what your last replies/posts were, especially when using @@!!.

|21:17 <hloeung> lastsent
|21:17 <mattermost> [@@jz6umt46w38spqcjppox6kk7ky] user1: my first message
|21:17 <mattermost> [@@ndziyrp7pig7zrsf643qiwe97a] #haw-test: Testing
|21:17 <mattermost> [@@zajoh97ms7f8jyyq1j3iu4nudr] user1: ok (re @user1: Here …)

@hloeung hloeung force-pushed the cache-last-sent-msgs branch 2 times, most recently from 68e09fb to 6841889 Compare December 12, 2022 10:15
@hloeung hloeung changed the title [WIP] Cache last sent msgs Cache last sent msgs Dec 14, 2022
@hloeung hloeung requested a review from 42wim December 14, 2022 23:00
@hloeung hloeung marked this pull request as ready for review December 14, 2022 23:00
@hloeung hloeung force-pushed the cache-last-sent-msgs branch from 528c5de to 46d218b Compare March 16, 2023 02:10
@hloeung hloeung force-pushed the cache-last-sent-msgs branch from 46d218b to 4c31930 Compare March 16, 2023 02:13
}
}

return false
m.msgLastSentCache.Add(msgID, fmt.Sprintf("%s: %s", channel, msg))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrt to line 732 to 751
I must be missing something but why do you want to add a message that's going to be skipped in to the cache?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only way we can get the message IDs for these messages we've sent. It goes through the server and back to us and that's when we add it to the cache.

@42wim 42wim added this to the 0.27.1 milestone Apr 3, 2023
@42wim 42wim merged commit 8a3b755 into 42wim:master Apr 3, 2023
@42wim
Copy link
Owner

42wim commented Apr 3, 2023

👍

@hloeung hloeung deleted the cache-last-sent-msgs branch April 3, 2023 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants