From 5edff0e7bf4c8831f9e37cb6085813e38fa87a5d Mon Sep 17 00:00:00 2001 From: Gerardo Rodriguez Date: Tue, 10 Nov 2026 06:23:28 +0000 Subject: [PATCH 1/3] msgconv/from-matrix: send location description as name --- pkg/msgconv/from-matrix.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/msgconv/from-matrix.go b/pkg/msgconv/from-matrix.go index ba2adc23..8e3e13fa 100644 --- a/pkg/msgconv/from-matrix.go +++ b/pkg/msgconv/from-matrix.go @@ -165,9 +165,11 @@ func (mc *MessageConverter) ToWhatsApp( message.LocationMessage = &waE2E.LocationMessage{ DegreesLatitude: &lat, DegreesLongitude: &long, - Comment: &content.Body, ContextInfo: contextInfo, } + if content.Body != "" && content.Body != content.GeoURI { + message.LocationMessage.Name = &content.Body + } default: return nil, nil, fmt.Errorf("%w %s", bridgev2.ErrUnsupportedMessageType, content.MsgType) } From 6cb748bc9c610b95e78e136332835e2363a7ad23 Mon Sep 17 00:00:00 2001 From: Gerardo Rodriguez Date: Tue, 10 Nov 2026 06:25:54 +0000 Subject: [PATCH 2/3] msgconv/from-matrix: prefer MSC3488 description and skip generated location bodies --- pkg/msgconv/from-matrix.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/msgconv/from-matrix.go b/pkg/msgconv/from-matrix.go index 8e3e13fa..9f703b73 100644 --- a/pkg/msgconv/from-matrix.go +++ b/pkg/msgconv/from-matrix.go @@ -167,8 +167,14 @@ func (mc *MessageConverter) ToWhatsApp( DegreesLongitude: &long, ContextInfo: contextInfo, } - if content.Body != "" && content.Body != content.GeoURI { - message.LocationMessage.Name = &content.Body + name := content.Body + if msc3488, ok := evt.Content.Raw["org.matrix.msc3488.location"].(map[string]any); ok { + if description, ok := msc3488["description"].(string); ok && description != "" { + name = description + } + } + if name != "" && !strings.Contains(name, "geo:") && !strings.Contains(name, "\n") { + message.LocationMessage.Name = &name } default: return nil, nil, fmt.Errorf("%w %s", bridgev2.ErrUnsupportedMessageType, content.MsgType) From 08f33e20cf7089638ea32eafdda3c4f621aef7aa Mon Sep 17 00:00:00 2001 From: Gerardo Rodriguez Date: Tue, 10 Nov 2026 19:00:42 +0000 Subject: [PATCH 3/3] msgconv/from-matrix: only use the MSC3488 description as the location name --- pkg/msgconv/from-matrix.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/msgconv/from-matrix.go b/pkg/msgconv/from-matrix.go index 9f703b73..47485854 100644 --- a/pkg/msgconv/from-matrix.go +++ b/pkg/msgconv/from-matrix.go @@ -165,17 +165,14 @@ func (mc *MessageConverter) ToWhatsApp( message.LocationMessage = &waE2E.LocationMessage{ DegreesLatitude: &lat, DegreesLongitude: &long, + Comment: &content.Body, ContextInfo: contextInfo, } - name := content.Body if msc3488, ok := evt.Content.Raw["org.matrix.msc3488.location"].(map[string]any); ok { if description, ok := msc3488["description"].(string); ok && description != "" { - name = description + message.LocationMessage.Name = &description } } - if name != "" && !strings.Contains(name, "geo:") && !strings.Contains(name, "\n") { - message.LocationMessage.Name = &name - } default: return nil, nil, fmt.Errorf("%w %s", bridgev2.ErrUnsupportedMessageType, content.MsgType) }