name = getIntent().getStringExtra(CHANNEL); imageUrl = getIntent().getStringExtra(IMAGE_LINK); groupType = getIntent().getIntExtra(GROUP_TYPE, Channel.GroupType.PUBLIC.getValue() .intValue()); } else {
if (Channel.GroupType.SUPPORT_GROUP.getValue().equals(channel.getType()) && User.RoleType.USER_ROLE.getValue().equals(MobiComUserPreference.getInstance(getContext()).getUserRoleType())) { return; return; if (alCustomizationSettings.isGroupInfoScreenVisible() && !Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType()) && !Channel.GroupType.OPEN.getValue().equals(channel.getType())) { Intent channelInfo = new Intent(getActivity(), ChannelInfoActivity.class); channelInfo.putExtra(ChannelInfoActivity.CHANNEL_KEY, channel.getKey()); startActivity(channelInfo); } else if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType()) && alCustomizationSettings.isUserProfileFragment()) { UserProfileFragment userProfileFragment = (UserProfileFragment) UIService.getFragmentByTag(getActivity(), ConversationUIService.USER_PROFILE_FRAMENT); if (userProfileFragment == null) {
alertDialog.setMessage(context.getString(R.string.delete_channel_messages_and_channel_info).replace(context.getString(R.string.group_name_info), channel.getName()).replace(context.getString(R.string.groupType_info), Channel.GroupType.BROADCAST.getValue().equals(channel.getType()) ? context.getString(R.string.broadcast_string) : context.getString(R.string.group_string))); alertDialog.setCancelable(true); alertDialog.create().show();
return; if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { if (getActivity() != null) { setToolbarSubtitle(getActivity().getString(R.string.is_typing));
currentConversationId = message.getConversationId(); channelKey = message.getGroupId(); if (Message.MessageType.MT_INBOX.getValue().equals(message.getType()) && (contact != null || (channel != null && !Channel.GroupType.OPEN.getValue().equals(channel.getType())))) { try { if (alCustomizationSettings.isMessageFastScrollEnabled()) {
alertDialog.setMessage(fragmentActivity.getString(R.string.delete_channel_messages_and_channel_info).replace(fragmentActivity.getString(R.string.group_name_info), channel.getName()).replace(fragmentActivity.getString(R.string.groupType_info), Channel.GroupType.BROADCAST.getValue().equals(channel.getType()) ? fragmentActivity.getString(R.string.broadcast_string) : fragmentActivity.getString(R.string.group_string))); alertDialog.setCancelable(true); alertDialog.create().show();
if (((channel != null && Channel.GroupType.OPEN.getValue().equals(channel.getType())) || message.isCall() || (message.hasAttachment() && !message.isAttachmentDownloaded()) || message.isVideoOrAudioCallMessage()) && (menuItems[i].equals(context.getResources().getString(R.string.forward)) || menuItems[i].equals(context.getResources().getString(R.string.resend)))) { continue; if (menuItems[i].equals(context.getResources().getString(R.string.reply)) && (!alCustomizationSettings.isReplyOption() || message.isAttachmentUploadInProgress() || TextUtils.isEmpty(message.getKeyString()) || !message.isSentToServer() || (message.hasAttachment() && !message.isAttachmentDownloaded()) || (channel != null && !Channel.GroupType.OPEN.getValue().equals(channel.getType()) && !ChannelService.getInstance(context).processIsUserPresentInChannel(channel.getKey())) || message.isVideoOrAudioCallMessage() || contact != null && contact.isDeleted())) { continue; if (menuItems[i].equals(context.getResources().getString(R.string.delete)) && (TextUtils.isEmpty(message.getKeyString()) || (channel != null && Channel.GroupType.OPEN.getValue().equals(channel.getType())))) { continue; if (menuItems[i].equals(context.getResources().getString(R.string.info)) && (TextUtils.isEmpty(message.getKeyString()) || (channel != null && Channel.GroupType.OPEN.getValue().equals(channel.getType())) || message.isVideoOrAudioCallMessage() || (channel != null && Channel.GroupType.OPEN.getValue().equals(channel.getType())))) { continue;
alertDialog.setMessage(context.getString(R.string.exit_channel_message_info).replace(context.getString(R.string.group_name_info), channel.getName()).replace(context.getString(R.string.groupType_info), Channel.GroupType.BROADCAST.getValue().equals(channel.getType()) ? context.getString(R.string.broadcast_string) : context.getString(R.string.group_string))); alertDialog.setCancelable(true); alertDialog.create().show();
if ((message.getGroupId() == null || (channel != null && (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType()) || Channel.GroupType.SUPPORT_GROUP.getValue().equals(channel.getType())))) && (menuItems[i].equals(context.getResources().getString(R.string.delete_group)) || menuItems[i].equals(context.getResources().getString(R.string.exit_group)))) { continue; if (menuItems[i].equals(context.getResources().getString(R.string.exit_group)) && (isChannelDeleted || !isUserPresentInGroup || (channel != null && Channel.GroupType.BROADCAST.getValue().equals(channel.getType())))) { continue;
String name = ""; if (channel != null) { if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { String userId = ChannelService.getInstance(context).getGroupOfTwoReceiverUserId(channel.getKey()); if (!TextUtils.isEmpty(userId)) {
if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { String userId = ChannelService.getInstance(getActivity()).getGroupOfTwoReceiverUserId(channel.getKey()); if (!TextUtils.isEmpty(userId)) {
alertDialog.setMessage(fragmentActivity.getString(R.string.exit_channel_message_info).replace(fragmentActivity.getString(R.string.group_name_info), channel.getName()).replace(fragmentActivity.getString(R.string.groupType_info), Channel.GroupType.BROADCAST.getValue().equals(channel.getType()) ? fragmentActivity.getString(R.string.broadcast_string) : fragmentActivity.getString(R.string.group_string))); alertDialog.setCancelable(true); alertDialog.create().show();
BroadcastService.currentConversationId = null; if (typingStarted) { if (contact != null || (channel != null && !Channel.GroupType.OPEN.getValue().equals(channel.getType()))) { Intent intent = new Intent(getActivity(), ApplozicMqttIntentService.class); intent.putExtra(ApplozicMqttIntentService.CHANNEL, channel);
if (channel != null && Channel.GroupType.OPEN.getValue().equals(channel.getType())) { sendOpenGroupMessage(messageEditText.getText().toString().trim()); } else {
if ((!ChannelService.getInstance(getActivity()).processIsUserPresentInChannel(channel.getKey()) && userNotAbleToChatLayout != null && !Channel.GroupType.OPEN.getValue().equals(channel.getType()))) { && !Channel.GroupType.OPEN.getValue().equals(channel.getType())) { individualMessageSendLayout.setVisibility(View.VISIBLE); userNotAbleToChatLayout.setVisibility(View.GONE);
String name = ""; if (channel != null) { if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { String userId = ChannelService.getInstance(fragmentActivity).getGroupOfTwoReceiverUserId(channel.getKey()); if (!TextUtils.isEmpty(userId)) {
if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { String userId = ChannelService.getInstance(getActivity()).getGroupOfTwoReceiverUserId(channel.getKey()); if (!TextUtils.isEmpty(userId)) {
String notificationTitle = null; if (channel != null) { if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { String userId = ChannelService.getInstance(context).getGroupOfTwoReceiverUserId(channel.getKey()); if (!TextUtils.isEmpty(userId)) { } else if (Channel.GroupType.SUPPORT_GROUP.getValue().equals(channel.getType())) { String userId = message.getTo(); if (!TextUtils.isEmpty(userId)) {
@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { int position = this.getLayoutPosition(); if (mItems.size() <= position) { return; } Message message = mItems.get(position); menu.setHeaderTitle(R.string.conversation_options); String[] menuItems = context.getResources().getStringArray(R.array.conversation_options_menu); properties.setMessage(message); boolean isChannelDeleted = properties.getChannel() != null && properties.getChannel().isDeleted(); boolean isUserPresentInGroup = properties.getChannel() != null && ChannelService.getInstance(context).processIsUserPresentInChannel(properties.getChannel().getKey()); for (int i = 0; i < menuItems.length; i++) { if ((message.getGroupId() == null || (properties.getChannel() != null && (Channel.GroupType.GROUPOFTWO.getValue().equals(properties.getChannel().getType()) || Channel.GroupType.SUPPORT_GROUP.getValue().equals(properties.getChannel().getType())))) && (menuItems[i].equals(context.getResources().getString(R.string.delete_group)) || menuItems[i].equals(context.getResources().getString(R.string.exit_group)))) { continue; } if (menuItems[i].equals(context.getResources().getString(R.string.exit_group)) && (isChannelDeleted || !isUserPresentInGroup)) { continue; } if (menuItems[i].equals(context.getResources().getString(R.string.delete_group)) && (isUserPresentInGroup || !isChannelDeleted)) { continue; } if (menuItems[i].equals(context.getResources().getString(R.string.delete_conversation))) { continue; } MenuItem item = menu.add(Menu.NONE, i, i, menuItems[i]); item.setOnMenuItemClickListener(onEditMenu); } }
protected void sendMessage() { if (channel != null) { if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { String userId = ChannelService.getInstance(getActivity()).getGroupOfTwoReceiverUserId(channel.getKey()); if (!TextUtils.isEmpty(userId)) { Contact withUserContact = appContactService.getContactById(userId); if (withUserContact.isBlocked()) { userBlockDialog(false, withUserContact, true); } else { processSendMessage(); } } } else if (Channel.GroupType.OPEN.getValue().equals(channel.getType())) { if (Utils.isInternetAvailable(getActivity())) { processSendMessage(); } else { Toast.makeText(getActivity(), getActivity().getString(R.string.internet_connection_not_available), Toast.LENGTH_SHORT).show(); } } else { processSendMessage(); } } else if (contact != null) { if (contact.isBlocked()) { userBlockDialog(false, contact, false); } else { processSendMessage(); } } }