@Override public void onItemClick(View view, int position, CallSTerminateMessage content, UIMessage message) { if (content.getReason() == OTHER_DEVICE_HAD_ACCEPTED){ return; } RongCallSession profile = RongCallClient.getInstance().getCallSession(); if (profile != null && profile.getActiveTime() > 0) { Toast.makeText(view.getContext(), profile.getMediaType() == RongCallCommon.CallMediaType.AUDIO ? view.getContext().getString(R.string.rc_voip_call_audio_start_fail) : view.getContext().getString(R.string.rc_voip_call_video_start_fail), Toast.LENGTH_SHORT) .show(); return; } RongCallCommon.CallMediaType mediaType = content.getMediaType(); String action = null; if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) { action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEVIDEO; } else { action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO; } Intent intent = new Intent(action); intent.setPackage(view.getContext().getPackageName()); intent.putExtra("conversationType", message.getConversationType().getName().toLowerCase(Locale.US)); intent.putExtra("targetId", message.getTargetId()); intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName()); view.getContext().startActivity(intent); }
@Override public boolean onMessageItemLongClick(Context context, UIMessage message) { Message[] messages = new Message[1]; messages[0] = message.getMessage(); if (message.getConversationType().equals(Conversation.ConversationType.PRIVATE)) { RongIM.getInstance().deleteRemoteMessages(message.getConversationType(), message.getTargetId(), messages, null); } else { RongIM.getInstance().deleteMessages(new int[]{message.getMessageId()}, null); } return false; } }).build();
&& (normalTime - message.getSentTime()) <= messageRecallInterval * 1000 && message.getSenderUserId().equals(RongIM.getInstance().getCurrentUserId()) && !message.getConversationType().equals(Conversation.ConversationType.CUSTOMER_SERVICE) && !message.getConversationType().equals(Conversation.ConversationType.APP_PUBLIC_SERVICE) && !message.getConversationType().equals(Conversation.ConversationType.PUBLIC_SERVICE) && !message.getConversationType().equals(Conversation.ConversationType.SYSTEM) && !message.getConversationType().equals(Conversation.ConversationType.CHATROOM)) { items = new String[] {view.getContext().getResources().getString(io.rong.imkit.R.string.rc_dialog_item_message_copy), view.getContext().getResources().getString(io.rong.imkit.R.string.rc_dialog_item_message_delete), view.getContext().getResources().getString(io.rong.imkit.R.string.rc_dialog_item_message_recall)}; } else {