From 9e752e637fdd2a5d91bc3fb33a53058f9a12f738 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 14 Jan 2020 18:53:45 +0100 Subject: show toast message on PN if user is not in room/channel --- src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java/de') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index b0d985f63..b2a1c8969 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -2015,6 +2015,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } public void privateMessageWith(final Jid counterpart) { + final Jid tcp = conversation.getMucOptions().getTrueCounterpart(counterpart); + if (!getConversation().getMucOptions().isUserInRoom(counterpart) && getConversation().getMucOptions().findUserByRealJid(tcp == null ? null : tcp.asBareJid()) == null) { + Toast.makeText(getActivity(), activity.getString(R.string.user_has_left_conference, counterpart.getResource()), Toast.LENGTH_SHORT).show(); + return; + } if (conversation.setOutgoingChatState(Config.DEFAULT_CHATSTATE)) { activity.xmppConnectionService.sendChatState(conversation); } -- cgit v1.2.3