sendDocumentMessage method
Implementation
sendDocumentMessage(
String documentPath, String replyMessageId, BuildContext context) async {
var busyStatus = !profile.isGroupProfile.checkNull()
? await Mirrorfly.isBusyStatusEnabled()
: false;
if (!busyStatus.checkNull()) {
if (isReplying.value) {
replyMessageId = replyChatMessage.messageId;
}
isReplying(false);
debugPrint("documentPath $documentPath");
Mirrorfly.sendMessage(
messageParams: MessageParams.document(
toJid: profile.jid.checkNull(),
replyMessageId: replyMessageId,
topicId: topicId,
fileMessageParams: FileMessageParams(file: File(documentPath))),
flyCallback: (response) {
if (response.isSuccess) {
mirrorFlyLog("document message", response.data.toString());
scrollToBottom();
updateLastMessage(response.data);
} else {
LogMessage.d("sendMessage", response.errorMessage);
showError(response.exception);
}
});
} else {
//show busy status popup
messageObject = MessageObject(
toJid: profile.jid.toString(),
replyMessageId: (isReplying.value)
? replyChatMessage.messageId
: Constants.emptyString,
messageType: Constants.mText,
file: documentPath);
if (context.mounted) showBusyStatusAlert(disableBusyChatAndSend, context);
}
}