From 263c62c1099ef9f7a625bf64eb0f559136fde528 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 20 Jul 2023 17:12:10 +0300 Subject: [PATCH] Allow reactions in all chats Apparently sometimes Google Messages allows reacting in SMS chats as well, maybe when the chat changes back and forth between RCS and SMS. --- portal.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/portal.go b/portal.go index 1b55534..17fee41 100644 --- a/portal.go +++ b/portal.go @@ -859,6 +859,7 @@ func (portal *Portal) GetBasePowerLevels() *event.PowerLevelsEventContent { Events: map[string]int{ event.StateRoomName.Type: anyone, event.StateRoomAvatar.Type: anyone, + event.EventReaction.Type: anyone, event.EventRedaction.Type: anyone, }, } @@ -870,17 +871,12 @@ func (portal *Portal) updatePowerLevels(conv *gmproto.Conversation, pl *event.Po expectedEventsDefault = 99 } - expectedReaction := 99 - if conv.GetType() == gmproto.ConversationType_RCS { - expectedReaction = 0 - } - changed := false if pl.EventsDefault != expectedEventsDefault { pl.EventsDefault = expectedEventsDefault changed = true } - changed = pl.EnsureEventLevel(event.EventReaction, expectedReaction) || changed + changed = pl.EnsureEventLevel(event.EventReaction, expectedEventsDefault) || changed // Explicitly set m.room.redaction level to 0 so redactions work even if sending is disabled changed = pl.EnsureEventLevel(event.EventRedaction, 0) || changed changed = pl.EnsureUserLevel(portal.bridge.Bot.UserID, 100) || changed