Support Discord Reply (fix #43)#124
Conversation
2b48f34 to
52bf0ee
Compare
|
Hello, thanks for submitting this PR here. I'm not yet very familiar how the reply system works, but i know it uses properties and methods on Editing I'm sorry it's not well documented yet. This is an area we haven't touched since forking, we've been more focused on file attachments for the moment. |
| return msg | ||
| } | ||
| refMsgRef := m.MessageReference | ||
| refMsg, err := s.ChannelMessage(refMsgRef.ChannelID, refMsgRef.MessageID) |
There was a problem hiding this comment.
This is a blocking network request, and should not be performed on the main thread (because it will block processing other events if the discord API takes some time). There's many ways to work around that. One would be instead of returning string from the method, you could return a boolean indicating whether the method is in fact handling a reply:
- if it is, just ignore it in the
createMessagemethod, and start a new goroutine inhandleQuote - if it's not, keep going with the original
msg
There was a problem hiding this comment.
An alternative could be to store the last ~100 messages or so per channel, so we don't have to do a network query at all.
|
Oh I just noticed this! This contrasts with #135 and #134. I assume you run a bridge that doesn't support reply tags, like IRC or Mumble. I mostly use XMPP though so I want the direct opposite approach.
I don't want Discord -> XMPP to add quotes, they'll be messy and redundant for my case. I wonder if the reply system needs to reworked at |
If you want to give it a shot, that would certainly be appreciated. I guess in the mean-time we could merge this as a temporary solution? |
Okay thanks for the vote of confidence in that direction :)
For what it's worth, I vote yes, keep the improvements coming ! It's crazy that the fix stalled out for 4 years. |
|
Thanks! |
That's reasonable. I opened #142 to track implementation of a new replies system. In the meantime, if there are any breaking changes in this PR, can someone who understands them (i.e. someone who uses Discord) open a new PR to update the changelog? EDIT: of course if there are no breaking changes, a changelog entry is more than welcome anyway, just not in the "breaking changes" section |
I built and deployed (for ref: from) with this patch in. Just rebooting led to this duplication, which I expected:
The quote box is the |
|
I'll trust your judgement on whether this should be the default behavior or not (it's not too late to make a new PR to disable it by default) :) |

Fixes #43