diff --git a/protocol/communities/manager_archive_mobile.go b/protocol/communities/manager_archive_mobile.go index 457a98416..9e24009cc 100644 --- a/protocol/communities/manager_archive_mobile.go +++ b/protocol/communities/manager_archive_mobile.go @@ -11,36 +11,36 @@ import ( "github.com/status-im/status-go/protocol/protobuf" ) -type ArchiveManagerMobile struct{} +type ArchiveManagerNop struct{} -func (amm *ArchiveManagerMobile) CreateHistoryArchiveTorrentFromMessages(communityID types.HexBytes, messages []*types.Message, topics []types.TopicType, startDate time.Time, endDate time.Time, partition time.Duration, encrypt bool) ([]string, error) { +func (amm *ArchiveManagerNop) CreateHistoryArchiveTorrentFromMessages(communityID types.HexBytes, messages []*types.Message, topics []types.TopicType, startDate time.Time, endDate time.Time, partition time.Duration, encrypt bool) ([]string, error) { return nil, nil } -func (amm *ArchiveManagerMobile) CreateHistoryArchiveTorrentFromDB(communityID types.HexBytes, topics []types.TopicType, startDate time.Time, endDate time.Time, partition time.Duration, encrypt bool) ([]string, error) { +func (amm *ArchiveManagerNop) CreateHistoryArchiveTorrentFromDB(communityID types.HexBytes, topics []types.TopicType, startDate time.Time, endDate time.Time, partition time.Duration, encrypt bool) ([]string, error) { return nil, nil } -func (amm *ArchiveManagerMobile) SaveMessageArchiveID(communityID types.HexBytes, hash string) error { +func (amm *ArchiveManagerNop) SaveMessageArchiveID(communityID types.HexBytes, hash string) error { return nil } -func (amm *ArchiveManagerMobile) GetMessageArchiveIDsToImport(communityID types.HexBytes) ([]string, error) { +func (amm *ArchiveManagerNop) GetMessageArchiveIDsToImport(communityID types.HexBytes) ([]string, error) { return nil, nil } -func (amm *ArchiveManagerMobile) SetMessageArchiveIDImported(communityID types.HexBytes, hash string, imported bool) error { +func (amm *ArchiveManagerNop) SetMessageArchiveIDImported(communityID types.HexBytes, hash string, imported bool) error { return nil } -func (amm *ArchiveManagerMobile) ExtractMessagesFromHistoryArchive(communityID types.HexBytes, archiveID string) ([]*protobuf.WakuMessage, error) { +func (amm *ArchiveManagerNop) ExtractMessagesFromHistoryArchive(communityID types.HexBytes, archiveID string) ([]*protobuf.WakuMessage, error) { return nil, nil } -func (amm *ArchiveManagerMobile) GetHistoryArchiveMagnetlink(communityID types.HexBytes) (string, error) { +func (amm *ArchiveManagerNop) GetHistoryArchiveMagnetlink(communityID types.HexBytes) (string, error) { return "", nil } -func (amm *ArchiveManagerMobile) LoadHistoryArchiveIndexFromFile(myKey *ecdsa.PrivateKey, communityID types.HexBytes) (*protobuf.WakuMessageArchiveIndex, error) { +func (amm *ArchiveManagerNop) LoadHistoryArchiveIndexFromFile(myKey *ecdsa.PrivateKey, communityID types.HexBytes) (*protobuf.WakuMessageArchiveIndex, error) { return nil, nil } diff --git a/protocol/communities/manager_torrent_mobile.go b/protocol/communities/manager_torrent_mobile.go index b08602584..45ba176ff 100644 --- a/protocol/communities/manager_torrent_mobile.go +++ b/protocol/communities/manager_torrent_mobile.go @@ -15,79 +15,76 @@ import ( "go.uber.org/zap" ) -type TorrentManagerMobile struct { - ArchiveManagerMobile - logger *zap.Logger +type TorrentManagerNop struct { + ArchiveManagerNop } // NewTorrentManager this function is only built and called when the "disable_torrent" build tag is set -// In this case this version of NewTorrentManager will return the mobile "nil" TorrentManagerMobile ensuring that the +// In this case this version of NewTorrentManager will return the mobile "nil" TorrentManagerNop ensuring that the // build command will not import or build the torrent deps for the mobile OS. // NOTE: It is intentional that this file contains the identical function name as in "manager_torrent.go" -func NewTorrentManager(torrentConfig *params.TorrentConfig, logger *zap.Logger, persistence *Persistence, transport *transport.Transport, identity *ecdsa.PrivateKey, encryptor *encryption.Protocol, publisher Publisher) *TorrentManagerMobile { - return &TorrentManagerMobile{ - logger: logger, - } +func NewTorrentManager(torrentConfig *params.TorrentConfig, logger *zap.Logger, persistence *Persistence, transport *transport.Transport, identity *ecdsa.PrivateKey, encryptor *encryption.Protocol, publisher Publisher) *TorrentManagerNop { + return &TorrentManagerNop{} } -func (tmm *TorrentManagerMobile) SetOnline(online bool) {} +func (tmm *TorrentManagerNop) SetOnline(online bool) {} -func (tmm *TorrentManagerMobile) SetTorrentConfig(*params.TorrentConfig) {} +func (tmm *TorrentManagerNop) SetTorrentConfig(*params.TorrentConfig) {} -func (tmm *TorrentManagerMobile) StartTorrentClient() error { +func (tmm *TorrentManagerNop) StartTorrentClient() error { return nil } -func (tmm *TorrentManagerMobile) Stop() error { +func (tmm *TorrentManagerNop) Stop() error { return nil } -func (tmm *TorrentManagerMobile) IsReady() bool { +func (tmm *TorrentManagerNop) IsReady() bool { return false } -func (tmm *TorrentManagerMobile) GetCommunityChatsFilters(communityID types.HexBytes) ([]*transport.Filter, error) { +func (tmm *TorrentManagerNop) GetCommunityChatsFilters(communityID types.HexBytes) ([]*transport.Filter, error) { return nil, nil } -func (tmm *TorrentManagerMobile) GetCommunityChatsTopics(communityID types.HexBytes) ([]types.TopicType, error) { +func (tmm *TorrentManagerNop) GetCommunityChatsTopics(communityID types.HexBytes) ([]types.TopicType, error) { return nil, nil } -func (tmm *TorrentManagerMobile) GetHistoryArchivePartitionStartTimestamp(communityID types.HexBytes) (uint64, error) { +func (tmm *TorrentManagerNop) GetHistoryArchivePartitionStartTimestamp(communityID types.HexBytes) (uint64, error) { return 0, nil } -func (tmm *TorrentManagerMobile) CreateAndSeedHistoryArchive(communityID types.HexBytes, topics []types.TopicType, startDate time.Time, endDate time.Time, partition time.Duration, encrypt bool) error { +func (tmm *TorrentManagerNop) CreateAndSeedHistoryArchive(communityID types.HexBytes, topics []types.TopicType, startDate time.Time, endDate time.Time, partition time.Duration, encrypt bool) error { return nil } -func (tmm *TorrentManagerMobile) StartHistoryArchiveTasksInterval(community *Community, interval time.Duration) { +func (tmm *TorrentManagerNop) StartHistoryArchiveTasksInterval(community *Community, interval time.Duration) { } -func (tmm *TorrentManagerMobile) StopHistoryArchiveTasksInterval(communityID types.HexBytes) {} +func (tmm *TorrentManagerNop) StopHistoryArchiveTasksInterval(communityID types.HexBytes) {} -func (tmm *TorrentManagerMobile) SeedHistoryArchiveTorrent(communityID types.HexBytes) error { +func (tmm *TorrentManagerNop) SeedHistoryArchiveTorrent(communityID types.HexBytes) error { return nil } -func (tmm *TorrentManagerMobile) UnseedHistoryArchiveTorrent(communityID types.HexBytes) {} +func (tmm *TorrentManagerNop) UnseedHistoryArchiveTorrent(communityID types.HexBytes) {} -func (tmm *TorrentManagerMobile) IsSeedingHistoryArchiveTorrent(communityID types.HexBytes) bool { +func (tmm *TorrentManagerNop) IsSeedingHistoryArchiveTorrent(communityID types.HexBytes) bool { return false } -func (tmm *TorrentManagerMobile) GetHistoryArchiveDownloadTask(communityID string) *HistoryArchiveDownloadTask { +func (tmm *TorrentManagerNop) GetHistoryArchiveDownloadTask(communityID string) *HistoryArchiveDownloadTask { return nil } -func (tmm *TorrentManagerMobile) AddHistoryArchiveDownloadTask(communityID string, task *HistoryArchiveDownloadTask) { +func (tmm *TorrentManagerNop) AddHistoryArchiveDownloadTask(communityID string, task *HistoryArchiveDownloadTask) { } -func (tmm *TorrentManagerMobile) DownloadHistoryArchivesByMagnetlink(communityID types.HexBytes, magnetlink string, cancelTask chan struct{}) (*HistoryArchiveDownloadTaskInfo, error) { +func (tmm *TorrentManagerNop) DownloadHistoryArchivesByMagnetlink(communityID types.HexBytes, magnetlink string, cancelTask chan struct{}) (*HistoryArchiveDownloadTaskInfo, error) { return nil, nil } -func (tmm *TorrentManagerMobile) TorrentFileExists(communityID string) bool { +func (tmm *TorrentManagerNop) TorrentFileExists(communityID string) bool { return false }