Skip to content

Commit

Permalink
fix: only dispatch magnetlink when owner of community
Browse files Browse the repository at this point in the history
  • Loading branch information
0x-r4bbit committed May 4, 2022
1 parent e39b835 commit 0c8d798
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions protocol/messenger_communities.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,16 @@ func (m *Messenger) handleCommunitiesHistoryArchivesSubscription(c chan *communi

m.config.messengerSignalsHandler.HistoryArchivesSeeding(sub.HistoryArchivesSeedingSignal.CommunityID)

err := m.dispatchMagnetlinkMessage(sub.HistoryArchivesSeedingSignal.CommunityID)
c, err := m.communitiesManager.GetByIDString(sub.HistoryArchivesSeedingSignal.CommunityID)
if err != nil {
m.logger.Debug("failed to dispatch magnetlink message", zap.Error(err))
m.logger.Debug("failed to retrieve community by id string", zap.Error(err))
}

if c.IsAdmin() {
err := m.dispatchMagnetlinkMessage(sub.HistoryArchivesSeedingSignal.CommunityID)
if err != nil {
m.logger.Debug("failed to dispatch magnetlink message", zap.Error(err))
}
}
}

Expand Down

0 comments on commit 0c8d798

Please sign in to comment.