Skip to content

Commit

Permalink
Fix error messages in portals with no relay webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 15, 2023
1 parent 9b7b609 commit 792ad54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,9 @@ func (portal *Portal) sendErrorMessage(msgType, message string, confirmed bool)
if confirmed {
certainty = "was not"
}
message = strings.ReplaceAll(message, portal.RelayWebhookSecret, "<redacted>")
if portal.RelayWebhookSecret != "" {
message = strings.ReplaceAll(message, portal.RelayWebhookSecret, "<redacted>")
}
resp, err := portal.sendMatrixMessage(portal.MainIntent(), event.EventMessage, &event.MessageEventContent{
MsgType: event.MsgNotice,
Body: fmt.Sprintf("\u26a0 Your %s %s bridged: %v", msgType, certainty, message),
Expand Down

0 comments on commit 792ad54

Please sign in to comment.