3
3
//
4
4
5
5
import Foundation
6
+ import StreamChat
6
7
7
8
/// Class providing implementations of several utilities used in the SDK.
8
9
/// The default implementations can be replaced in the init method, or directly via the variables.
@@ -20,6 +21,7 @@ public class Utils {
20
21
public var commandsConfig : CommandsConfig
21
22
public var messageListConfig : MessageListConfig
22
23
public var composerConfig : ComposerConfig
24
+ public var shouldSyncChannelControllerOnAppear : ( ChatChannelController ) -> Bool
23
25
24
26
var messageCachingUtils = MessageCachingUtils ( )
25
27
@@ -36,7 +38,8 @@ public class Utils {
36
38
commandsConfig: CommandsConfig = DefaultCommandsConfig ( ) ,
37
39
messageListConfig: MessageListConfig = MessageListConfig ( ) ,
38
40
composerConfig: ComposerConfig = ComposerConfig ( ) ,
39
- channelNamer: @escaping ChatChannelNamer = DefaultChatChannelNamer ( )
41
+ channelNamer: @escaping ChatChannelNamer = DefaultChatChannelNamer ( ) ,
42
+ shouldSyncChannelControllerOnAppear: @escaping ( ChatChannelController ) -> Bool = { _ in true }
40
43
) {
41
44
self . dateFormatter = dateFormatter
42
45
self . videoPreviewLoader = videoPreviewLoader
@@ -51,5 +54,6 @@ public class Utils {
51
54
self . commandsConfig = commandsConfig
52
55
self . messageListConfig = messageListConfig
53
56
self . composerConfig = composerConfig
57
+ self . shouldSyncChannelControllerOnAppear = shouldSyncChannelControllerOnAppear
54
58
}
55
59
}
0 commit comments