@@ -159,15 +159,15 @@ import UIKit
159159 self . roomId = roomId
160160 }
161161
162- func bindChatDriver( _ driver: IMessageListDrive ) {
162+ @ objc public func bindChatDriver( _ driver: IMessageListDrive ) {
163163 self . chatDrive = driver
164164 }
165165
166- func bindGiftDriver( _ driver: IGiftMessageListDrive ) {
166+ @ objc public func bindGiftDriver( _ driver: IGiftMessageListDrive ) {
167167 self . giftDrive = driver
168168 }
169169
170- func bindGlobalNotifyDriver( driver: IGlobalBoardcastViewDrive ) {
170+ @ objc public func bindGlobalNotifyDriver( driver: IGlobalBoardcastViewDrive ) {
171171 self . notifyDrive = driver
172172 }
173173
@@ -188,7 +188,7 @@ import UIKit
188188 }
189189 }
190190
191- private func cleanCache( ) {
191+ @ objc open func cleanCache( ) {
192192 self . roomId = " "
193193 self . roomService = nil
194194 self . giftDrive = nil
@@ -228,7 +228,7 @@ import UIKit
228228// })
229229// }
230230
231- @objc public func enterRoom( completion: @escaping ( ChatError ? ) -> Void ) {
231+ @objc open func enterRoom( completion: @escaping ( ChatError ? ) -> Void ) {
232232 if let userId = ChatroomContext . shared? . currentUser? . userId {
233233 self . roomService? . chatroomOperating ( roomId: self . roomId, userId: userId, type: . join) { [ weak self] success, error in
234234 guard let `self` = self else { return }
@@ -244,7 +244,7 @@ import UIKit
244244 }
245245 }
246246
247- @objc public func leaveRoom( completion: @escaping ( ChatError ? ) -> Void ) {
247+ @objc open func leaveRoom( completion: @escaping ( ChatError ? ) -> Void ) {
248248 self . roomService? . chatroomOperating ( roomId: self . roomId, userId: ChatClient . shared ( ) . currentUsername ?? " " , type: . leave, completion: { [ weak self] success, error in
249249 if success {
250250 self ? . cleanCache ( )
@@ -253,7 +253,7 @@ import UIKit
253253 } )
254254 }
255255
256- @objc public func destroyed( completion: @escaping ( ChatError ? ) -> Void ) {
256+ @objc open func destroyed( completion: @escaping ( ChatError ? ) -> Void ) {
257257 self . roomService? . chatroomOperating ( roomId: self . roomId, userId: ChatClient . shared ( ) . currentUsername ?? " " , type: . destroyed, completion: { [ weak self] success, error in
258258 if success {
259259 self ? . cleanCache ( )
@@ -264,7 +264,7 @@ import UIKit
264264
265265 //MARK: - Participants operation
266266 @objc ( kickUserWithId: completion: )
267- public func kick( userId: String , completion: @escaping ( ChatError ? ) -> Void ) {
267+ open func kick( userId: String , completion: @escaping ( ChatError ? ) -> Void ) {
268268 self . roomService? . operatingUser ( roomId: self . roomId, userId: userId, type: . kick, completion: { [ weak self] success, error in
269269 if error == nil {
270270 NotificationCenter . default. post ( name: NSNotification . Name ( " ChatroomUIKitKickUserSuccess " ) , object: userId)
@@ -276,7 +276,7 @@ import UIKit
276276 }
277277
278278 @objc ( muteUserWithId: completion: )
279- public func mute( userId: String , completion: @escaping ( ChatError ? ) -> Void ) {
279+ open func mute( userId: String , completion: @escaping ( ChatError ? ) -> Void ) {
280280 self . roomService? . operatingUser ( roomId: self . roomId, userId: userId, type: . mute, completion: { [ weak self] success, error in
281281 if error == nil {
282282 ChatroomContext . shared? . muteMap ? [ userId] = true
@@ -287,7 +287,7 @@ import UIKit
287287 }
288288
289289 @objc ( unmuteUserWithId: completion: )
290- public func unmute( userId: String , completion: @escaping ( ChatError ? ) -> Void ) {
290+ open func unmute( userId: String , completion: @escaping ( ChatError ? ) -> Void ) {
291291 self . roomService? . operatingUser ( roomId: self . roomId, userId: userId, type: . unmute, completion: { [ weak self] success, error in
292292 if error == nil {
293293 ChatroomContext . shared? . muteMap? . removeValue ( forKey: userId)
@@ -297,7 +297,7 @@ import UIKit
297297 } )
298298 }
299299
300- @objc public func fetchParticipants( pageSize: UInt , completion: @escaping ( ( [ UserInfoProtocol ] ? , ChatError ? ) -> Void ) ) {
300+ @objc open func fetchParticipants( pageSize: UInt , completion: @escaping ( ( [ UserInfoProtocol ] ? , ChatError ? ) -> Void ) ) {
301301 self . roomService? . fetchParticipants ( roomId: self . roomId, pageSize: pageSize, completion: { [ weak self] userIds, error in
302302 guard let `self` = self else { return }
303303 if let ids = userIds {
@@ -357,7 +357,7 @@ import UIKit
357357 }
358358
359359 @objc ( fetchMuteUsersWithPageSize: completion: )
360- public func fetchMuteUsers( pageSize: UInt , completion: @escaping ( ( [ UserInfoProtocol ] ? , ChatError ? ) -> Void ) ) {
360+ open func fetchMuteUsers( pageSize: UInt , completion: @escaping ( ( [ UserInfoProtocol ] ? , ChatError ? ) -> Void ) ) {
361361 self . roomService? . fetchMuteUsers ( roomId: self . roomId, pageNum: UInt ( self . pageNumOfMute) , pageSize: pageSize, completion: { [ weak self] userIds, error in
362362 guard let `self` = self else { return }
363363 if error == nil {
@@ -410,7 +410,7 @@ import UIKit
410410 /// - unknownUserIds: User ID array without user information
411411 /// - completion: Callback user infos and error.
412412 @objc ( fetchThenCacheUserInfosOnEndScrollWithunknownUserIds: completion: )
413- public func fetchThenCacheUserInfosOnEndScroll( unknownUserIds: [ String ] , completion: @escaping ( ( [ UserInfoProtocol ] ? , ChatError ? ) -> Void ) ) {
413+ open func fetchThenCacheUserInfosOnEndScroll( unknownUserIds: [ String ] , completion: @escaping ( ( [ UserInfoProtocol ] ? , ChatError ? ) -> Void ) ) {
414414 ChatroomUIKitClient . shared. userImplement? . userInfos ( userIds: unknownUserIds, completion: { infos, error in
415415 if error == nil {
416416 for info in infos {
@@ -448,7 +448,7 @@ import UIKit
448448// }
449449 //MARK: - Message operation
450450 @objc ( translateWithMessage: completion: )
451- public func translate( message: ChatMessage , completion: @escaping ( ChatError ? ) -> Void ) {
451+ open func translate( message: ChatMessage , completion: @escaping ( ChatError ? ) -> Void ) {
452452 self . roomService? . translateMessage ( message: message, completion: { [ weak self] translateResult, error in
453453 if error == nil , let translation = translateResult {
454454 self ? . chatDrive? . refreshMessage ( message: translation)
@@ -459,7 +459,7 @@ import UIKit
459459 }
460460
461461 @objc ( recallWithMessage: completion: )
462- public func recall( message: ChatMessage , completion: @escaping ( ChatError ? ) -> Void ) {
462+ open func recall( message: ChatMessage , completion: @escaping ( ChatError ? ) -> Void ) {
463463 self . roomService? . recall ( messageId: message. messageId, completion: { [ weak self] error in
464464 if error == nil {
465465 self ? . chatDrive? . removeMessage ( message: message)
@@ -470,7 +470,7 @@ import UIKit
470470 }
471471
472472 @objc ( reportWithMessage: tag: reason: completion: )
473- public func report( message: ChatMessage , tag: String , reason: String , completion: @escaping ( ChatError ? ) -> Void ) {
473+ open func report( message: ChatMessage , tag: String , reason: String , completion: @escaping ( ChatError ? ) -> Void ) {
474474 self . roomService? . report ( messageId: message. messageId, tag: tag, reason: reason, completion: { [ weak self] error in
475475 self ? . handleError ( type: . report, error: error)
476476 completion ( error)
0 commit comments