fix: only dispatch magnetlink when owner of community
This commit is contained in:
parent
43d6305157
commit
d11290ef4a
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue