parsingMsg method
dynamic
parsingMsg(
- WKMsg wkMsg
)
Implementation
parsingMsg(WKMsg wkMsg) {
if (wkMsg.content == '') {
wkMsg.contentType = WkMessageContentType.contentFormatError;
return;
}
dynamic json = jsonDecode(wkMsg.content);
if (json == null) {
wkMsg.contentType = WkMessageContentType.contentFormatError;
return;
}
if (wkMsg.fromUID == "") {
wkMsg.fromUID = WKDBConst.readString(json, 'from_uid');
}
if (wkMsg.channelType == WKChannelType.personal &&
wkMsg.channelID != '' &&
wkMsg.fromUID != '' &&
wkMsg.channelID == WKIM.shared.options.uid) {
wkMsg.channelID = wkMsg.fromUID;
}
if (wkMsg.contentType == WkMessageContentType.insideMsg) {
if (json != null) {
json['channel_id'] = wkMsg.channelID;
json['channel_type'] = wkMsg.channelType;
}
WKIM.shared.cmdManager.handleCMD(json);
}
}