I overrode both
channel(_:didUpdate:) but both weren’t called.
I couldn’t investigate further into the issue caused from the REST API route, so I checked what was going on with
Two places in
SBUBaseChannelViewController are immediately responsible for the issue, but I can see how other parts need to be updated in order to support thread replies properly.
upsertMessagesInList(messages:needUpdateNewMessage:needReload:) seems to be the part that updates the local message list cache for responsiveness. (I may be wrong. I didn’t spend too much time reading the sample code…) Messages are appended to
messageList regardless of whether they are replies or messages to the channel. Adding a guard
message.parentMessageId == 0 resolves the issue.
preSendMessages are uniformly added to
SBUPendingMessageManager. The condition check leading to the code should add one more predicate:
preSendMessage.parentMessageId == 0.
Regardless, this only solves the issue of the message bubble showing up. Thread info for the parent message is not updated,