Skip to content

Commit

Permalink
Assume participant ID 1 is always self
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jul 30, 2024
1 parent 7b086f8 commit 3a215b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ type ConvertedMessage struct {
}

func (portal *Portal) getIntent(ctx context.Context, source *User, participant string) *appservice.IntentAPI {
if source.IsSelfParticipantID(participant) {
if source.IsSelfParticipantID(participant) || participant == "1" {
intent := source.DoublePuppetIntent
if intent == nil {
zerolog.Ctx(ctx).Debug().Msg("Dropping message from self as double puppeting is not enabled")
Expand Down Expand Up @@ -1515,6 +1515,9 @@ func (portal *Portal) SyncParticipants(ctx context.Context, source *User, metada
filteredParticipants = append(filteredParticipants, participant)
}
for _, participant := range filteredParticipants {
if participant.ID.ParticipantID == "1" {
portal.zlog.Warn().Any("participant", participant).Msg("Found non-self participant with ID 1")
}
puppet := source.GetPuppetByID(participant.ID.ParticipantID, participant.ID.Number)
if puppet == nil {
portal.zlog.Error().Any("participant_id", participant.ID).Msg("Failed to get puppet for participant")
Expand Down

0 comments on commit 3a215b5

Please sign in to comment.