modifyMessage method
Future<V2TimValueCallback<V2TimMessageChangeInfo> >
modifyMessage({
- required V2TimMessage message,
Implementation
Future<V2TimValueCallback<V2TimMessageChangeInfo>> modifyMessage({
required V2TimMessage message,
}) async {
try {
final res = await wrappedPromiseToFuture(timeweb!.modifyMessage(parse(message.messageFromWeb!)));
final code = res.code;
if (code == 0) {
final responses = await V2TIMMessage.convertMessageFromWebToDart(jsToMap(res.data)["message"]);
return CommonUtils.returnSuccess<V2TimMessageChangeInfo>({"message": responses, "code": res.code});
} else {
return CommonUtils.returnSuccess<V2TimMessageChangeInfo>({"code": res.code, "desc": res.data});
}
} catch (error) {
return CommonUtils.returnErrorForValueCb(error.toString());
}
}