42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

Allow adding or removing reactions #386

Closed hloeung closed 3 years ago

hloeung commented 3 years ago

This is to specific posts/messages, using the same syntax as you would via the Mattermost UI (+:emoji_name: and -:emoji_name:).

|20:22 <hloeung> @@e9jdm8qwxtdq88nb949i6tcp6y +:coffee:
|20:22 <hloeung> added reaction: coffee [↪@@e9jdm8qwxtdq88nb949i6tcp6y]
|20:22 <hloeung> @@e9jdm8qwxtdq88nb949i6tcp6y -:coffee:
|20:22 <hloeung> removed reaction: coffee [↪@@e9jdm8qwxtdq88nb949i6tcp6y]

One for you @devec0 but too late ;)

axinojolais commented 3 years ago

How do you get the ID of a message ?

hloeung commented 3 years ago

How do you get the ID of a message ?

That's already provided if ThreadContext = "mattermost" and using either SuffixContext or PrefixContext.

Only works with single messages, not replies to threads at the moment. We could have matterircd show both thread/parent ID and message IDs, will have to think more about this one.

42wim commented 3 years ago

@hloeung cool! I suggest calling the methods AddReaction and RemoveReaction to be consistent with the ReactionAdd and ReactionRemove events

hloeung commented 3 years ago

@hloeung cool! I suggest calling the methods AddReaction and RemoveReaction to be consistent with the ReactionAdd and ReactionRemove events

Will rename.

Also, do you prefer I push up additional commits to these WIP/draft changes or commit --amend and push --force?

What's left with this MP/PR before it's ready for review is to add support for matterircd prefix context, e.g. @@01a +:emoji:

hloeung commented 3 years ago
|17:12 <hloeung> @@001 +:+1:
|17:12 <hloeung> added reaction: +1 [001]
|17:15 <hloeung> @@001 -:+1:
|17:16 <hloeung> removed reaction: +1 [001]
hloeung commented 3 years ago

Large paste:

|21:48 <hloeung> Testing one
|21:48 <hloeung> Testing two
|21:48 <hloeung> @@66dfpgmkztfrtetuwhx5wbmcty +:+1:
|21:48 <hloeung> Testing three
|21:48 <hloeung> Testing four
|21:48 <hloeung> added reaction: +1 [↪66dfp…]

Produces this:

SfYuEyYy12

42wim commented 3 years ago

Also, do you prefer I push up additional commits to these WIP/draft changes or commit --amend and push --force?

Whatever matches your workflow best. I you have useful commits (with correct naming convention) I won't squash them.

hloeung commented 3 years ago

Going to separate out 4678d3be0638856549bc405d33e6454a2e01c64b to a different PR.

42wim commented 3 years ago

thx, will look/test it this weekend

42wim commented 3 years ago

sorry for the delay

hloeung commented 3 years ago

No problems at all. Thanks!

furai commented 3 years ago

Hmm, missing documentation for this in prefixcontext.md?

hloeung commented 3 years ago

Hmm, missing documentation for this in prefixcontext.md?

Ah, apologies. Here it is https://github.com/42wim/matterircd/pull/405

furai commented 3 years ago

Thanks!