@Override public void onClick(DialogInterface dialogInterface, int i) { blockUserProcess(withUserContact.getUserId(), block, isFromChannel); } });
@Override public void onResume() { super.onResume(); if (contact != null) { BroadcastService.currentUserProfileUserId = contact.getUserId(); refreshContactData(); } }
public void deleteContact(Contact contact) { deleteContactById(contact.getUserId()); }
public void updateLocalImageUri(Contact contact) { ContentValues contentValues = new ContentValues(); contentValues.put(MobiComDatabaseHelper.CONTACT_IMAGE_LOCAL_URI, contact.getLocalImageUrl()); int updatedRow = dbHelper.getWritableDatabase().update(CONTACT, contentValues, MobiComDatabaseHelper.USERID + "=?", new String[]{contact.getUserId()}); }
@Override public void run() { Message message = null; if (channelKey != null && channelKey != 0) { message = latestMessageForEachContact.get(ConversationUIService.GROUP + channelKey); } else { message = latestMessageForEachContact.get(contact.getUserId()); } if (message == null) { return; } messageList.remove(message); if (channelKey != null && channelKey != 0) { latestMessageForEachContact.remove(ConversationUIService.GROUP + channelKey); } else { latestMessageForEachContact.remove(contact.getUserId()); } recyclerAdapter.notifyDataSetChanged(); checkForEmptyConversations(); } });
public void processUserStatus(Contact contact) { if (contact != null && contact.getContactIds() != null) { processUserStatus(contact.getUserId(), false); } }
@Override protected void onPostExecute(File file) { super.onPostExecute(file); if (contextWeakReference != null) { Context context = contextWeakReference.get(); if (file != null && file.exists() && context != null) { Uri fileUri = Uri.parse(file.getAbsolutePath()); Intent sendAttachmentIntent = new Intent(context, MobiComAttachmentSelectorActivity.class); if (channel != null) { sendAttachmentIntent.putExtra(MobiComAttachmentSelectorActivity.GROUP_ID, channel.getKey()); sendAttachmentIntent.putExtra(MobiComAttachmentSelectorActivity.GROUP_NAME, channel.getName()); } else if (contact != null) { sendAttachmentIntent.putExtra(MobiComAttachmentSelectorActivity.USER_ID, contact.getUserId()); sendAttachmentIntent.putExtra(MobiComAttachmentSelectorActivity.DISPLAY_NAME, contact.getDisplayName()); } if (fileUri != null) { sendAttachmentIntent.putExtra(MobiComAttachmentSelectorActivity.URI_LIST, fileUri); } context.startActivity(sendAttachmentIntent); } } } }
public void unMuteUserChat() { Date date = Calendar.getInstance(TimeZone.getTimeZone("UTC")).getTime(); millisecond = date.getTime(); final MuteUserNotificationAsync.TaskListener taskListener = new MuteUserNotificationAsync.TaskListener() { @Override public void onSuccess(String status, Context context) { if (menu != null) { menu.findItem(R.id.unmuteGroup).setVisible(false); menu.findItem(R.id.muteGroup).setVisible(true); } } @Override public void onFailure(String error, Context context) { } }; new MuteUserNotificationAsync(taskListener, millisecond, contact.getUserId(), getContext()).execute(); }
public void updateContact(Contact contact) { ContentValues contentValues = prepareContactValues(contact); dbHelper.getWritableDatabase().update(CONTACT, contentValues, MobiComDatabaseHelper.USERID + "=?", new String[]{contact.getUserId()}); dbHelper.close(); }
@Override public void onClick(DialogInterface dialog, final int selectedItem) { if (selectedItem == 0) { millisecond = millisecond + 28800000; } else if (selectedItem == 1) { millisecond = millisecond + 604800000; } else if (selectedItem == 2) { millisecond = millisecond + 31558000000L; } new MuteUserNotificationAsync(listener, millisecond, contact.getUserId(), getContext()).execute(); dialog.dismiss(); } });
public void typingStopped(Contact contact, Channel channel) { String currentId; if (channel != null) { currentId = String.valueOf(channel.getKey()); } else { currentId = contact.getUserId(); } MobiComUserPreference mobiComUserPreference = MobiComUserPreference.getInstance(context); publishTopic(getApplicationKey(context), "0", mobiComUserPreference.getUserId(), currentId); }
/** * This method will return full name of contact to be updated. * This is require to avoid updating full name back to userId in case fullname is not set while updating contact. * * @param contact * @return */ private String getFullNameForUpdate(Contact contact) { String fullName = contact.getDisplayName(); if (TextUtils.isEmpty(contact.getFullName())) { Contact contactFromDB = getContactById(contact.getUserId()); if (contactFromDB != null) { fullName = contactFromDB.getFullName(); } } return fullName; }
public void typingStarted(Contact contact, Channel channel) { String currentId; if (channel != null) { currentId = String.valueOf(channel.getKey()); } else { currentId = contact.getUserId(); } MobiComUserPreference mobiComUserPreference = MobiComUserPreference.getInstance(context); publishTopic(getApplicationKey(context), "1", mobiComUserPreference.getUserId(), currentId); }
public void updateMessageKeyString(Message message) { if (!BroadcastService.isIndividual()) { return; } String userId = message.getContactIds(); ConversationFragment conversationFragment = getConversationFragment(); if (conversationFragment != null && !TextUtils.isEmpty(userId) && conversationFragment.getContact() != null && userId.equals(conversationFragment.getContact().getUserId()) || conversationFragment.getCurrentChannelKey(message.getGroupId())) { conversationFragment.updateMessageKeyString(message); } }
public void muteUserChat(boolean mute, String userId) { if (getConversationFragment() != null && getConversationFragment().getContact() != null && getConversationFragment().getContact().getUserId().equals(userId)) { getConversationFragment().muteUser(mute); } }
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 synchronized void processConversationArray(Conversation[] conversations, Channel channel, Contact contact) { if (conversations != null && conversations.length > 0) { for (Conversation conversation : conversations) { if (channel != null) { conversation.setGroupId(channel.getKey()); } else if (contact != null) { conversation.setUserId(contact.getUserId()); conversation.setGroupId(0); } if (conversationDatabaseService.isConversationPresent(conversation.getId())) { conversationDatabaseService.updateConversation(conversation); } else { conversationDatabaseService.addConversation(conversation); } } } }
public void saveOrUpdate(Contact contact) { Contact existingContact = getContactById(contact.getUserId()); if (existingContact == null) { addContact(contact); } else { if (Contact.ContactType.DEVICE_AND_APPLOZIC.getValue().equals(existingContact.getDeviceContactType())) { contact.setDeviceContactType(existingContact.getDeviceContactType()); } else if (Contact.ContactType.DEVICE_AND_APPLOZIC.getValue().equals(contact.getDeviceContactType())) { contact.setDeviceContactType(existingContact.getDeviceContactType()); } updateContact(contact); } }