@Override public void onClick(View v) { AppCompatCheckBox checkBox = (AppCompatCheckBox) v; if (checkBox.isChecked()) { userIdList.add(contact.getContactIds()); } else if (!checkBox.isChecked()) { userIdList.remove(contact.getContactIds()); } } });
public void refreshContactData() { if (contact != null) { contact = contactService.getContactById(contact.getContactIds()); } }
public String getServerSyncCallKey(Contact contact, Channel channel, Integer conversationId) { return SERVER_SYNC.replace("[CONVERSATION]", conversationId != null ? String.valueOf(conversationId) : "") .replace("[CONTACT]", contact != null ? contact.getContactIds() : "") .replace("[CHANNEL]", channel != null ? String.valueOf(channel.getKey()) : ""); }
public void deleteConversationThreadFromServer(Contact contact) { if (TextUtils.isEmpty(contact.getContactIds())) { return; } try { String url = getMessageThreadDeleteUrl() + "?userId=" + contact.getContactIds(); String response = httpRequestUtils.getResponse(url, "text/plain", "text/plain"); Utils.printLog(context, TAG, "Delete messages response from server: " + response + contact.getContactIds()); } catch (Exception e) { e.printStackTrace(); } }
public String getDisplayName() { if (formattedContactNumber != null) { return TextUtils.isEmpty(phoneDisplayName) ? TextUtils.isEmpty(getFormattedContactNumber()) ? getContactIds() : getFormattedContactNumber() : phoneDisplayName; } return TextUtils.isEmpty(fullName) ? getContactIds() : fullName; }
public void deleteAndBroadCast(final Contact contact, boolean deleteFromServer) { deleteConversationFromDevice(contact.getContactIds()); if (deleteFromServer) { Thread thread = new Thread(new Runnable() { @Override public void run() { messageClientService.deleteConversationThreadFromServer(contact); } }); thread.setPriority(Process.THREAD_PRIORITY_BACKGROUND); thread.start(); } BroadcastService.sendConversationDeleteBroadcast(context, BroadcastService.INTENT_ACTIONS.DELETE_CONVERSATION.toString(), contact.getContactIds(), 0, "success"); }
public void updateReadStatus(Contact contact, Channel channel) { String contactNumberParameter = ""; String response = ""; if (contact != null && !TextUtils.isEmpty(contact.getContactIds())) { contactNumberParameter = "?userId=" + contact.getContactIds(); } else if (channel != null) { contactNumberParameter = "?groupId=" + channel.getKey(); } response = httpRequestUtils.getResponse(getUpdateReadStatusUrl() + contactNumberParameter, "text/plain", "text/plain"); Utils.printLog(context, TAG, "Read status response is " + response); }
public void processUserStatus(Contact contact) { if (contact != null && contact.getContactIds() != null) { processUserStatus(contact.getUserId(), false); } }
public String syncDeleteConversationThreadFromServer(Contact contact, Channel channel) { String response = null; String parameterString = ""; try { if (contact != null && !TextUtils.isEmpty(contact.getContactIds())) { parameterString = "?userId=" + contact.getContactIds(); } else if (channel != null) { parameterString = "?groupId=" + channel.getKey(); } String url = getMessageThreadDeleteUrl() + parameterString; response = httpRequestUtils.getResponse(url, "text/plain", "text/plain"); Utils.printLog(context, TAG, "Delete messages response from server: " + response); } catch (Exception e) { e.printStackTrace(); } return response; }
public boolean deleteMessage(Message message, Contact contact) { if (!message.isSentToServer()) { deleteMessageFromDevice(message, contact != null ? contact.getContactIds() : null); return true; } String response = messageClientService.deleteMessage(message, contact); if ("success".equals(response)) { deleteMessageFromDevice(message, contact != null ? contact.getContactIds() : null); } else { messageDatabaseService.updateDeleteSyncStatus(message, "1"); } return true; }
public String deleteMessage(Message message, Contact contact) { String contactNumberParameter = ""; String response = ""; if (contact != null && !TextUtils.isEmpty(contact.getContactIds())) { try { contactNumberParameter = "&userId=" + contact.getContactIds(); } catch (Exception e) { e.printStackTrace(); } } if (message.isSentToServer()) { response = httpRequestUtils.getResponse(getMessageDeleteUrl() + "?key=" + message.getKeyString() + contactNumberParameter, "text/plain", "text/plain"); Utils.printLog(context, TAG, "delete response is " + response); } return response; }
private void updateStatus(String contactId, boolean markRead) { if (!BroadcastService.isIndividual()) { return; } ConversationFragment conversationFragment = getConversationFragment(); if (conversationFragment != null && !TextUtils.isEmpty(contactId) && conversationFragment.getContact() != null && contactId.equals(conversationFragment.getContact().getContactIds())) { conversationFragment.updateDeliveryStatusForAllMessages(markRead); } }
public boolean isMessageForCurrentConversation(Message message) { return (message.getGroupId() != null && channel != null && message.getGroupId().equals(channel.getKey())) || (!TextUtils.isEmpty(message.getContactIds()) && contact != null && message.getContactIds().equals(contact.getContactIds())) && message.getGroupId() == null; }
void reload() { StringBuffer stringBufferTitle = new StringBuffer(); if (contact != null) { Contact updatedInfoContact = baseContactService.getContactById(contact.getContactIds()); if (updatedInfoContact != null && (!TextUtils.isEmpty(contact.getDisplayName())) && (!contact.getDisplayName().equals(updatedInfoContact.getDisplayName()))) { stringBufferTitle.append(updatedInfoContact.getDisplayName()); } } if (stringBufferTitle != null) { ((CustomToolbarListener)getActivity()).setToolbarTitle(contact.getDisplayName()); } }
@NonNull private Message getVideoCallStatusMessage(Contact contact) { Message notificationMessage = new Message(); MobiComUserPreference userPreferences = MobiComUserPreference.getInstance(context); notificationMessage.setContactIds(contact.getContactIds()); notificationMessage.setTo(contact.getContactIds()); notificationMessage.setCreatedAtTime(System.currentTimeMillis()); notificationMessage.setStoreOnDevice(Boolean.TRUE); notificationMessage.setSendToDevice(Boolean.TRUE); notificationMessage.setContentType(Message.ContentType.VIDEO_CALL_STATUS_MSG.getValue()); notificationMessage.setDeviceKeyString(userPreferences.getDeviceKeyString()); return notificationMessage; }
@NonNull private Message getNotificationMessage(Contact contact) { Message notificationMessage = new Message(); MobiComUserPreference userPreferences = MobiComUserPreference.getInstance(context); notificationMessage.setContactIds(contact.getContactIds()); notificationMessage.setTo(contact.getContactIds()); notificationMessage.setCreatedAtTime(System.currentTimeMillis()); notificationMessage.setStoreOnDevice(Boolean.TRUE); notificationMessage.setSendToDevice(Boolean.TRUE); notificationMessage.setContentType(Message.ContentType.VIDEO_CALL_NOTIFICATION_MSG.getValue()); notificationMessage.setDeviceKeyString(userPreferences.getDeviceKeyString()); notificationMessage.setMessage(videoCallId); return notificationMessage; }
public void updateTypingStatus(String userId, String isTypingStatus) { if (!BroadcastService.isIndividual()) { return; } ConversationFragment conversationFragment = getConversationFragment(); Utils.printLog(fragmentActivity, TAG, "Received typing status for: " + userId); if (conversationFragment != null && conversationFragment.getContact() != null && userId.equals(conversationFragment.getContact().getContactIds()) || conversationFragment.getChannel() != null) { conversationFragment.updateUserTypingStatus(userId, isTypingStatus); } }
public void processVideoCall(Contact contactObj, Integer conversationId) { this.contact = baseContactService.getContactById(contactObj.getContactIds()); if (ApplozicClient.getInstance(getApplicationContext()).isIPCallEnabled()) { try { if (Utils.hasMarshmallow() && !PermissionsUtils.checkPermissionForCameraAndMicrophone(this)) { applozicPermission.checkRuntimePermissionForCameraAndAudioRecording(); return; } String activityName = ApplozicSetting.getInstance(this).getActivityCallback(ApplozicSetting.RequestCode.VIDEO_CALL); Class activityToOpen = Class.forName(activityName); Intent intent = new Intent(this, activityToOpen); intent.putExtra("CONTACT_ID", contact.getUserId()); startActivity(intent); } catch (Exception e) { e.printStackTrace(); } } }
public void updateLastSeenStatus(String contactId) { if (BroadcastService.isQuick() && getQuickConversationFragment() != null) { getQuickConversationFragment().updateLastSeenStatus(contactId); return; } if (BroadcastService.isIndividual()) { ConversationFragment conversationFragment = getConversationFragment(); if (conversationFragment != null && conversationFragment.getContact() != null && contactId.equals(conversationFragment.getContact().getContactIds()) || conversationFragment.getChannel() != null) { conversationFragment.updateLastSeenStatus(); } } }
public void updateLastSeenStatus() { if (this.getActivity() == null) { return; } if (contact != null) { contact = appContactService.getContactById(contact.getContactIds()); } if (contact != null) { processUpdateLastSeenStatus(contact); } else if (channel != null && Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { String userId = ChannelService.getInstance(getActivity()).getGroupOfTwoReceiverUserId(channel.getKey()); if (!TextUtils.isEmpty(userId)) { Contact withUserContact = appContactService.getContactById(userId); processUpdateLastSeenStatus(withUserContact); } } }