Skip to content

Commit 6956a0f

Browse files
committed
.
1 parent e4413c9 commit 6956a0f

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

pkg/connector/events.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ func (evt *WAUndecryptableMessage) ConvertMessage(ctx context.Context, portal *b
340340
}
341341
content := &undecryptableMessageContent
342342
if evt.Type == events.UnavailableTypeViewOnce {
343-
verb := "sent"
344-
extra := ""
345-
if !evt.Info.IsFromMe {
346-
verb = "received"
347-
extra = " For added privacy, you can only open it on the WhatsApp app."
348-
}
349-
body := fmt.Sprintf("You %s a view once message.%s", verb, extra)
343+
verb := "sent"
344+
extra := ""
345+
if !evt.Info.IsFromMe {
346+
verb = "received"
347+
extra = " For added privacy, you can only open it on the WhatsApp app."
348+
}
349+
body := fmt.Sprintf("You %s a view once message.%s", verb, extra)
350350
content = &event.MessageEventContent{
351351
MsgType: event.MsgNotice,
352352
Body: body,

pkg/msgconv/wa-media.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,13 @@ func (mc *MessageConverter) convertMediaMessage(
5454
cachedPart *bridgev2.ConvertedMessagePart,
5555
) (part *bridgev2.ConvertedMessagePart, contextInfo *waE2E.ContextInfo) {
5656
if mc.DisableViewOnce && isViewOnce {
57-
verb := "received"
58-
if messageInfo.IsFromMe {
59-
verb = "sent"
60-
}
61-
body := fmt.Sprintf("You %s a view once %s.", verb, typeName)
57+
verb := "sent"
58+
extra := ""
6259
if !messageInfo.IsFromMe {
63-
body += " For added privacy, you can only open it on the WhatsApp app."
60+
verb = "received"
61+
extra = " For added privacy, you can only open it on the WhatsApp app."
6462
}
63+
body := fmt.Sprintf("You %s a view once %s.%s", verb, typeName, extra)
6564
return &bridgev2.ConvertedMessagePart{
6665
Type: event.EventMessage,
6766
Content: &event.MessageEventContent{

0 commit comments

Comments
 (0)