Skip to content

Commit

Permalink
connector/tomatrix: fix broadcast messages with no From user
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Jan 10, 2025
1 parent c3fc77c commit d7bc97e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pkg/connector/tomatrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,19 @@ func (c *TelegramClient) convertToMatrix(ctx context.Context, portal *bridgev2.P
if peerType, _, err := ids.ParsePortalID(portal.ID); err != nil {
return nil, err
} else if peerType == ids.PeerTypeChannel && !portal.Metadata.(*PortalMetadata).IsSuperGroup {
var profile event.BeeperPerMessageProfile
if msg.Out {
profile, err = portal.PerMessageProfileForSender(ctx, c.userID)
} else {
profile, err = portal.PerMessageProfileForSender(ctx, c.getPeerSender(msg.FromID).Sender)
}
if err != nil {
return nil, err
profile, err := portal.PerMessageProfileForSender(ctx, c.userID)
if err != nil {
return nil, err
}
perMessageProfile = &profile
} else if fromID, ok := msg.GetFromID(); ok {
profile, err := portal.PerMessageProfileForSender(ctx, c.getPeerSender(fromID).Sender)
if err != nil {
return nil, err
}
perMessageProfile = &profile
}
perMessageProfile = &profile
}

cm = &bridgev2.ConvertedMessage{}
Expand Down

0 comments on commit d7bc97e

Please sign in to comment.