mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[WIP] Topics
This commit is contained in:
@@ -2,17 +2,21 @@ import Foundation
|
||||
import Postbox
|
||||
import SwiftSignalKit
|
||||
|
||||
func _internal_storedMessageFromSearchPeer(account: Account, peer: Peer) -> Signal<PeerId, NoError> {
|
||||
return account.postbox.transaction { transaction -> PeerId in
|
||||
func _internal_storedMessageFromSearchPeer(account: Account, peer: Peer) -> Signal<Peer, NoError> {
|
||||
return account.postbox.transaction { transaction -> Peer in
|
||||
if transaction.getPeer(peer.id) == nil {
|
||||
updatePeers(transaction: transaction, peers: [peer], update: { previousPeer, updatedPeer in
|
||||
return updatedPeer
|
||||
})
|
||||
}
|
||||
if let group = transaction.getPeer(peer.id) as? TelegramGroup, let migrationReference = group.migrationReference {
|
||||
return migrationReference.peerId
|
||||
if let migrationPeer = transaction.getPeer(migrationReference.peerId) {
|
||||
return migrationPeer
|
||||
} else {
|
||||
return peer
|
||||
}
|
||||
}
|
||||
return peer.id
|
||||
return peer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user