summaryrefslogtreecommitdiffstats
path: root/gateway
diff options
context:
space:
mode:
authorvpzomtrrfrt <colin@vpzom.click>2022-01-09 14:46:59 -0800
committerGitHub <noreply@github.com>2022-01-09 23:46:59 +0100
commit9a8ce9b17e560433731eb5efa3cee7ced0b93605 (patch)
tree38d4c3392d1778d28a21b7a81d5a8cfc5440a705 /gateway
parent16ab4c6fed397306030318a6a0900e208ff784e3 (diff)
downloadmatterbridge-msglm-9a8ce9b17e560433731eb5efa3cee7ced0b93605.tar.gz
matterbridge-msglm-9a8ce9b17e560433731eb5efa3cee7ced0b93605.tar.bz2
matterbridge-msglm-9a8ce9b17e560433731eb5efa3cee7ced0b93605.zip
Reply support for Matrix (#1664)
* Post replies to matrix * Handle replies from matrix * Include protocol in canonical ID return * fmt
Diffstat (limited to 'gateway')
-rw-r--r--gateway/gateway.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go
index 1c6c21c3..85f5a187 100644
--- a/gateway/gateway.go
+++ b/gateway/gateway.go
@@ -66,7 +66,7 @@ func New(rootLogger *logrus.Logger, cfg *config.Gateway, r *Router) *Gateway {
func (gw *Gateway) FindCanonicalMsgID(protocol string, mID string) string {
ID := protocol + " " + mID
if gw.Messages.Contains(ID) {
- return mID
+ return ID
}
// If not keyed, iterate through cache for downstream, and infer upstream.
@@ -75,7 +75,7 @@ func (gw *Gateway) FindCanonicalMsgID(protocol string, mID string) string {
ids := v.([]*BrMsgID)
for _, downstreamMsgObj := range ids {
if ID == downstreamMsgObj.ID {
- return strings.Replace(mid.(string), protocol+" ", "", 1)
+ return mid.(string)
}
}
}
@@ -454,9 +454,9 @@ func (gw *Gateway) SendMessage(
msg.Channel = rmsg.Channel
}
- msg.ParentID = gw.getDestMsgID(rmsg.Protocol+" "+canonicalParentMsgID, dest, channel)
+ msg.ParentID = gw.getDestMsgID(canonicalParentMsgID, dest, channel)
if msg.ParentID == "" {
- msg.ParentID = canonicalParentMsgID
+ msg.ParentID = strings.Replace(canonicalParentMsgID, dest.Protocol+" ", "", 1)
}
// if the parentID is still empty and we have a parentID set in the original message