use of com.applozic.mobicomkit.ConversationRunnables in project Applozic-Android-SDK by AppLozic.
the class SyncCallService method syncMessageMetadataUpdate.
public synchronized void syncMessageMetadataUpdate(String key, boolean isFromFcm, Message message) {
Integer groupId = null;
if (message != null) {
if (message.getGroupId() != null) {
groupId = message.getGroupId();
Channel channel = ChannelService.getInstance(context).getChannel(groupId);
if (channel != null && channel.isOpenGroup()) {
if (message.hasAttachment()) {
messageDatabaseService.replaceExistingMessage(message);
}
BroadcastService.updateMessageMetadata(context, message.getKeyString(), BroadcastService.INTENT_ACTIONS.MESSAGE_METADATA_UPDATE.toString(), null, groupId, true, message.getMetadata());
return;
}
}
}
if (!TextUtils.isEmpty(key) && mobiComMessageService.isMessagePresent(key)) {
if (Utils.isDeviceInIdleState(context)) {
new ConversationRunnables(context, null, false, false, true);
} else {
Utils.printLog(context, TAG, "Syncing updated message metadata from " + (isFromFcm ? "FCM" : "MQTT") + " for message key : " + key);
ConversationWorker.enqueueWorkMessageMetadataUpdate(context);
}
}
}
Aggregations