fix: only dispatch magnetlink when owner of community

This commit is contained in:
Pascal Precht 2022-05-04 13:42:10 +02:00 committed by r4bbit.eth
parent 43d6305157
commit d11290ef4a
1 changed files with 9 additions and 2 deletions

View File

@ -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))
}
}
}