clearDraft method
Implementation
Future<void> clearDraft() async {
if (!_canUseChatSession) return;
final targetEngine = _sessionEngine;
if (targetEngine == null) return;
final requestId = ++_conversationDraftRequestId;
final type = _con.conversationType ?? RCIMIWConversationType.invalid;
final targetId = _con.targetId ?? '';
final channelId = _con.channelId;
await targetEngine.clearDraftMessage(
type,
targetId,
channelId,
callback: IRCIMIWClearDraftMessageCallback(
onDraftMessageCleared: (code) {
if (code == 0 &&
requestId == _conversationDraftRequestId &&
_isSessionEngineCurrent(targetEngine)) {
_con.draft = null;
notifyListeners();
}
},
),
);
}