MessageCollection
@objc(SBDMessageCollection)
open class MessageCollection : BaseCollection
extension MessageCollection: GroupChannelDelegate
extension MessageCollection: ConnectionDelegate
An object that accesses the cache for the messages.
Since
3.1.0-
Undocumented
Declaration
Swift
@objc open weak var delegate: MessageCollectionDelegate? { get set }
-
Message collection delegate.
Declaration
Swift
@objc open internal(set) var startingPoint: Int64 { get }
-
If
true
, there may be the messages on the next page.Declaration
Swift
@objc open internal(set) var hasNext: Bool { get }
-
If
true
, there may be the messages on the previous page.Declaration
Swift
@objc open internal(set) var hasPrevious: Bool { get }
-
Returns the succeeded messages that are already loaded in memory.
Declaration
Swift
@objc open var succeededMessages: [BaseMessage] { get }
-
Returns the pending messages that are already loaded in memory.
Declaration
Swift
@objc open var pendingMessages: [BaseMessage] { get }
-
Returns the failed messages that are already loaded in memory.
Declaration
Swift
@objc open var failedMessages: [BaseMessage] { get }
-
Starts the message collection with the policy. The result of the
Declaration
Swift
@objc open func startCollection( initPolicy: MessageCollectionInitPolicy, cacheResultHandler: MessageListHandler?, apiResultHandler: MessageListHandler? )
Parameters
initPolicy
The policy for the message collection.
cacheResultHandler
The callback to call when the messages are loaded from the cache. The
messages
is the messages that are loaded from the cache. Theerror
will be returned when the loading message failed.apiResultHandler
The callback to call when the messages are loaded from the server. The
messages
is the messages that are loaded from the server. Theerror
will be returned when the loading message failed. -
Invalidates the object.
Declaration
Swift
@objc open func dispose()
-
Loads messages of the next page.
Declaration
Swift
@objc open func loadNext(completionHandler: @escaping MessageListHandler)
Parameters
completionHandler
The callback to call when the load is complete. The
error
will be returned when the loading message failed. -
Loads messages of the previous page.
Declaration
Swift
@objc open func loadPrevious(completionHandler: @escaping MessageListHandler)
Parameters
completionHandler
The callback to call when the load is complete. The
error
will be returned when the loading message failed. -
Removes failed messages from DB.
Declaration
Swift
@objc open func removeFailed(messages: [BaseMessage], completionHandler: MessageRequestIdsHandler?)
Parameters
completionHandler
The callback to call when the method is complete. The
error
will be returned when the removing failed messages failed. -
Removes all failed messages.
Declaration
Swift
@objc open func removeAllFailed(completionHandler: SBErrorHandler?)
Parameters
completionHandler
The callback to call when the method is complete. The
error
will be returned when the removing failed messages failed.
-
Declaration
Swift
open func channel(_ channel: BaseChannel, didReceive message: BaseMessage)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, didUpdate message: BaseMessage)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, messageWasDeleted messageId: Int64)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, updatedReaction reactionEvent: ReactionEvent)
-
Declaration
Swift
open func channel( _ channel: BaseChannel, didUpdateThreadInfo threadInfoUpdateEvent: ThreadInfoUpdateEvent )
-
Declaration
Swift
open func channelWasChanged(_ channel: BaseChannel)
-
Declaration
Swift
open func channel( _ channel: GroupChannel, didReceiveInvitation invitees: [User]?, inviter: User? )
-
Declaration
Swift
open func channelDidUpdateDeliveryStatus(_ channel: GroupChannel)
-
Declaration
Swift
open func channelDidUpdateReadStatus(_ channel: GroupChannel)
-
Declaration
Swift
open func channelDidChangeMemberCount(_ channels: [GroupChannel])
-
Declaration
Swift
open func channel(_ channel: BaseChannel, userWasMuted user: RestrictedUser)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, userWasUnmuted user: User)
-
Declaration
Swift
open func channelWasFrozen(_ channel: BaseChannel)
-
Declaration
Swift
open func channelWasUnfrozen(_ channel: BaseChannel)
-
Declaration
Swift
open func channelWasHidden(_ channel: GroupChannel)
-
Declaration
Swift
open func channelDidUpdateOperators(_ channel: BaseChannel)
-
Declaration
Swift
open func channelDidUpdateTypingStatus(_ channel: GroupChannel)
-
Declaration
Swift
open func channel(_ channel: GroupChannel, userDidLeave user: User)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, userWasBanned user: RestrictedUser)
-
Declaration
Swift
open func channel(_ channel: GroupChannel, didDeclineInvitation invitee: User, inviter: User?)
-
Declaration
Swift
open func channel(_ channel: GroupChannel, userDidJoin user: User)
-
Declaration
Swift
open func channelWasDeleted(_ channelURL: String, channelType: ChannelType)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, didReceiveMention message: BaseMessage)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, createdMetaData: [String : String]?)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, updatedMetaData: [String : String]?)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, deletedMetaDataKeys: [String]?)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, createdMetaCounters: [String : Int]?)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, updatedMetaCounters: [String : Int]?)
-
Declaration
Swift
open func channel(_ channel: BaseChannel, deletedMetaCountersKeys: [String]?)
-
Declaration
Swift
open func channel(_ channel: GroupChannel, didUpdatePoll event: PollUpdateEvent)
-
Declaration
Swift
open func channel(_ channel: GroupChannel, didVotePoll event: PollVoteEvent)
-
Declaration
Swift
open func channelDidUpdatePinnedMessages(_ channel: GroupChannel)
-
Declaration
Swift
open func channel(_ channel: GroupChannel, didUpdateFeedbackMessage: BaseMessage)
-
Declaration
Swift
public func didStartReconnection()
-
Declaration
Swift
open func didSucceedReconnection()
-
Declaration
Swift
open func didConnect(userId: String)