From bdb970b8ada0363b9bc01d211f4af794b52c9284 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 28 Nov 2017 20:48:45 +0100 Subject: some bug fixes --- .../de/pixart/messenger/entities/MucOptions.java | 5 +- .../de/pixart/messenger/parser/MessageParser.java | 8 +- .../pixart/messenger/persistance/FileBackend.java | 4 +- .../persistance/OnPhoneContactsMerged.java | 2 +- .../pixart/messenger/ui/ConversationActivity.java | 6 +- .../pixart/messenger/ui/ConversationFragment.java | 13 ++- .../java/de/pixart/messenger/ui/XmppActivity.java | 4 +- .../messenger/ui/adapter/MessageAdapter.java | 127 +++++++++++---------- .../pixart/messenger/ui/widget/CopyTextView.java | 2 +- .../messenger/ui/widget/ListSelectionManager.java | 5 +- .../utils/OnPhoneContactsLoadedListener.java | 2 +- .../java/de/pixart/messenger/utils/UIHelper.java | 9 +- .../xmpp/OnAdvancedStreamFeaturesLoaded.java | 2 +- .../de/pixart/messenger/xmpp/OnBindListener.java | 2 +- .../messenger/xmpp/OnContactStatusChanged.java | 2 +- .../pixart/messenger/xmpp/OnKeyStatusUpdated.java | 2 +- .../messenger/xmpp/OnMessageAcknowledged.java | 2 +- .../messenger/xmpp/OnMessagePacketReceived.java | 2 +- .../messenger/xmpp/OnPresencePacketReceived.java | 2 +- .../de/pixart/messenger/xmpp/OnStatusChanged.java | 2 +- .../pixart/messenger/xmpp/OnUpdateBlocklist.java | 4 +- .../de/pixart/messenger/xmpp/PacketReceived.java | 2 +- .../xmpp/jingle/OnTransportConnected.java | 4 +- 23 files changed, 114 insertions(+), 99 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java index 50ea4c2fb..67c02b543 100644 --- a/src/main/java/de/pixart/messenger/entities/MucOptions.java +++ b/src/main/java/de/pixart/messenger/entities/MucOptions.java @@ -439,11 +439,13 @@ public class MucOptions { break; } } + boolean self = user.realJid != null && user.realJid.equals(account.getJid().toBareJid()); if (membersOnly() && nonanonymous() && user.affiliation.ranks(Affiliation.MEMBER) && user.realJid != null - && !realJidInMuc) { + && !realJidInMuc + && !self) { user.role = Role.NONE; user.avatar = null; user.fullJid = null; @@ -593,6 +595,7 @@ public class MucOptions { public List getUsers(int max) { ArrayList subset = new ArrayList<>(); HashSet jids = new HashSet<>(); + jids.add(account.getJid().toBareJid()); synchronized (users) { for(User user : users) { if (user.getRealJid() == null || jids.add(user.getRealJid())) { diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java index 7a82c9b98..60c97f394 100644 --- a/src/main/java/de/pixart/messenger/parser/MessageParser.java +++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java @@ -336,11 +336,11 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece mXmppConnectionService.getMessageArchiveService().processFinLegacy(fin, original.getFrom()); return; } - final boolean mamlegacy = original.hasChild("result", Namespace.MAM_LEGACY); - final Element result = original.findChild("result", mamlegacy ? Namespace.MAM_LEGACY : Namespace.MAM); + final boolean mamLegacy = original.hasChild("result", Namespace.MAM_LEGACY); + final Element result = original.findChild("result", mamLegacy ? Namespace.MAM_LEGACY : Namespace.MAM); final MessageArchiveService.Query query = result == null ? null : mXmppConnectionService.getMessageArchiveService().findQuery(result.getAttribute("queryid")); if (query != null && query.validFrom(original.getFrom())) { - Pair f = original.getForwardedMessagePacket("result", mamlegacy ? Namespace.MAM_LEGACY : Namespace.MAM); + Pair f = original.getForwardedMessagePacket("result", mamLegacy ? Namespace.MAM_LEGACY : Namespace.MAM); if (f == null) { return; } @@ -714,7 +714,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece if (message.addReadByMarker(readByMarker)) { Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": added read by (" + readByMarker.getRealJid() + ") to message '" + message.getBody() + "'"); mXmppConnectionService.updateMessage(message); - mXmppConnectionService.markMessage(message, Message.STATUS_SEND_DISPLAYED); + mXmppConnectionService.markMessage(account, from.toBareJid(), id, Message.STATUS_SEND_DISPLAYED); } } } diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java index 3a53d31b9..1d143cc53 100644 --- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java @@ -545,7 +545,7 @@ public class FileBackend { } public Uri getTakePhotoUri() { - File file = new File(getTakeFromCameraPath() + "IMG_" + fileDateFormat.format(new Date()) + ".jpg"); + File file = new File(getTakeFromCameraPath() + "IMG_" + this.fileDateFormat.format(new Date()) + ".jpg"); file.getParentFile().mkdirs(); return getUriForFile(mXmppConnectionService, file); } @@ -577,7 +577,7 @@ public class FileBackend { } public Uri getTakeVideoUri() { - File file = new File(getTakeFromCameraPath() + "VID_" + fileDateFormat.format(new Date()) + ".mp4"); + File file = new File(getTakeFromCameraPath() + "VID_" + this.fileDateFormat.format(new Date()) + ".mp4"); file.getParentFile().mkdirs(); return getUriForFile(mXmppConnectionService, file); } diff --git a/src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java b/src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java index 6c7b0e52c..d5253f227 100644 --- a/src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java +++ b/src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java @@ -1,5 +1,5 @@ package de.pixart.messenger.persistance; public interface OnPhoneContactsMerged { - void phoneContactsMerged(); + public void phoneContactsMerged(); } diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index 2a65570de..b4968770a 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -192,7 +192,11 @@ public class ConversationActivity extends XmppActivity } public boolean isConversationsOverviewHideable() { - return mContentView instanceof SlidingPaneLayout; + if (mContentView instanceof SlidingPaneLayout) { + return true; + } else { + return false; + } } public boolean isConversationsOverviewVisable() { diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index e0f6e2157..4872dc841 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -57,6 +57,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import de.pixart.messenger.Config; import de.pixart.messenger.R; +import de.pixart.messenger.crypto.axolotl.AxolotlService; import de.pixart.messenger.entities.Account; import de.pixart.messenger.entities.Blockable; import de.pixart.messenger.entities.Contact; @@ -604,8 +605,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa if (message.getEncryption() == Message.ENCRYPTION_PGP || message.getEncryption() == Message.ENCRYPTION_DECRYPTED) { fingerprint = "pgp"; - } else if (message.getEncryption() == Message.ENCRYPTION_OTR) { - fingerprint = "otr"; } else { fingerprint = message.getFingerprint(); } @@ -625,6 +624,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa if (message.getEncryption() == Message.ENCRYPTION_PGP || message.getEncryption() == Message.ENCRYPTION_DECRYPTED) { fingerprint = "pgp"; + } else if (message.getEncryption() == Message.ENCRYPTION_OTR) { + fingerprint = "otr"; } else { fingerprint = message.getFingerprint(); } @@ -1164,14 +1165,15 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa && conversation.isWithStranger()) { showSnackbar(R.string.received_message_from_stranger, R.string.block, mBlockClickListener); } else if (activity.xmppConnectionService.warnUnecryptedChat()) { + AxolotlService axolotlService = account.getAxolotlService(); if ((mode == Conversation.MODE_SINGLE) && (conversation.getNextEncryption() == Message.ENCRYPTION_NONE && - ((Config.supportOmemo() && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) || + ((Config.supportOmemo() && axolotlService != null && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) || (Config.supportOpenPgp() && account.isPgpDecryptionServiceConnected()) || Config.supportOtr()))) { showSnackbar(R.string.conversation_unencrypted_hint, R.string.ok, mHideUnencryptionHint, null); } else if ((mode == Conversation.MODE_MULTI && conversation.getMucOptions().membersOnly() && conversation.getMucOptions().nonanonymous()) && (conversation.getNextEncryption() == Message.ENCRYPTION_NONE && - ((Config.supportOmemo() && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) || + ((Config.supportOmemo() && axolotlService != null && conversation.getAccount().getAxolotlService().isConversationAxolotlCapable(conversation)) || (Config.supportOpenPgp() && account.isPgpDecryptionServiceConnected())))) { showSnackbar(R.string.conversation_unencrypted_hint, R.string.ok, mHideUnencryptionHint, null); } else { @@ -1204,6 +1206,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa } protected void messageSent() { + mSendingPgpMessage.set(false); mEditMessage.setText(""); if (conversation.setCorrectingMessage(null)) { mEditMessage.append(conversation.getDraftMessage()); @@ -1743,7 +1746,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa final Intent data) { if (resultCode == Activity.RESULT_OK) { if (requestCode == ConversationActivity.REQUEST_DECRYPT_PGP) { - activity.getSelectedConversation().getAccount().getPgpDecryptionService().continueDecryption(true); + activity.getSelectedConversation().getAccount().getPgpDecryptionService().continueDecryption(data); } else if (requestCode == ConversationActivity.REQUEST_TRUST_KEYS_TEXT) { final String body = mEditMessage.getText().toString(); Message message = new Message(conversation, body, conversation.getNextEncryption()); diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 44ef30a85..6263c2e53 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -172,11 +172,11 @@ public abstract class XmppActivity extends Activity { abstract protected void refreshUiReal(); protected interface OnValueEdited { - void onValueEdited(String value); + public void onValueEdited(String value); } public interface OnPresenceSelected { - void onPresenceSelected(); + public void onPresenceSelected(); } protected ServiceConnection mConnection = new ServiceConnection() { diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 286d841bf..9fca230be 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -175,7 +175,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie @Override public int getItemViewType(int position) { - return getItemViewType(getItem(position)); + return this.getItemViewType(getItem(position)); } public int getMessageTextColor(boolean onDark, boolean primary) { @@ -198,6 +198,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie if (viewHolder.edit_indicator != null) { if (message.edited()) { viewHolder.edit_indicator.setVisibility(View.VISIBLE); + viewHolder.edit_indicator.setAlpha(0.7f); } else { viewHolder.edit_indicator.setVisibility(View.GONE); } @@ -459,10 +460,9 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie } private void displayTextMessage(final ViewHolder viewHolder, final Message message, boolean darkBackground, int type) { - if (viewHolder.download_button != null) { - viewHolder.download_button.setVisibility(View.GONE); - } + viewHolder.download_button.setVisibility(View.GONE); viewHolder.image.setVisibility(View.GONE); + viewHolder.audioPlayer.setVisibility(View.GONE); viewHolder.messageBody.setVisibility(View.VISIBLE); viewHolder.messageBody.setTextColor(this.getMessageTextColor(darkBackground, true)); viewHolder.messageBody.setLinkTextColor(this.getMessageTextColor(darkBackground, true)); @@ -750,7 +750,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie } @Override - public View getView(int position, View unused, ViewGroup parent) { + public View getView(int position, View view, ViewGroup parent) { final Message message = getItem(position); final boolean omemoEncryption = message.getEncryption() == Message.ENCRYPTION_AXOLOTL; final boolean isInValidSession = message.isValidInSession() && (!omemoEncryption || message.isTrusted()); @@ -758,61 +758,63 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie final Account account = conversation.getAccount(); final int type = getItemViewType(position); ViewHolder viewHolder; - View view; - viewHolder = new ViewHolder(); - switch (type) { - case DATE_SEPARATOR: - view = activity.getLayoutInflater().inflate(R.layout.message_date_bubble, parent, false); - viewHolder.status_message = view.findViewById(R.id.status_message); - break; - case SENT: - view = activity.getLayoutInflater().inflate(R.layout.message_sent, parent, false); - viewHolder.message_box = view.findViewById(R.id.message_box); - viewHolder.contact_picture = view.findViewById(R.id.message_photo); - viewHolder.audioPlayer = view.findViewById(R.id.audio_player); - viewHolder.download_button = view.findViewById(R.id.download_button); - viewHolder.resend_button = view.findViewById(R.id.resend_button); - viewHolder.indicator = view.findViewById(R.id.security_indicator); - viewHolder.edit_indicator = view.findViewById(R.id.edit_indicator); - viewHolder.image = view.findViewById(R.id.message_image); - viewHolder.messageBody = view.findViewById(R.id.message_body); - viewHolder.time = view.findViewById(R.id.message_time); - viewHolder.indicatorReceived = view.findViewById(R.id.indicator_received); - viewHolder.indicatorRead = view.findViewById(R.id.indicator_read); - break; - case RECEIVED: - view = activity.getLayoutInflater().inflate(R.layout.message_received, parent, false); - viewHolder.message_box = view.findViewById(R.id.message_box); - viewHolder.contact_picture = view.findViewById(R.id.message_photo); - viewHolder.audioPlayer = view.findViewById(R.id.audio_player); - viewHolder.download_button = view.findViewById(R.id.download_button); - viewHolder.indicator = view.findViewById(R.id.security_indicator); - viewHolder.edit_indicator = view.findViewById(R.id.edit_indicator); - viewHolder.image = view.findViewById(R.id.message_image); - viewHolder.messageBody = view.findViewById(R.id.message_body); - viewHolder.time = view.findViewById(R.id.message_time); - viewHolder.indicatorReceived = view.findViewById(R.id.indicator_received); - viewHolder.encryption = view.findViewById(R.id.message_encryption); - break; - case STATUS: - view = activity.getLayoutInflater().inflate(R.layout.message_status, parent, false); - viewHolder.contact_picture = view.findViewById(R.id.message_photo); - viewHolder.status_message = view.findViewById(R.id.status_message); - viewHolder.load_more_messages = view.findViewById(R.id.load_more_messages); - break; - default: - throw new AssertionError("Unknown view type"); - } - if (viewHolder.messageBody != null) { - listSelectionManager.onCreate(viewHolder.messageBody, new MessageBodyActionModeCallback(viewHolder.messageBody)); - viewHolder.messageBody.setCopyHandler(this); - } - view.setTag(viewHolder); - if (viewHolder == null) { - return view; + if (view == null) { + viewHolder = new ViewHolder(); + switch (type) { + case DATE_SEPARATOR: + view = activity.getLayoutInflater().inflate(R.layout.message_date_bubble, parent, false); + viewHolder.status_message = view.findViewById(R.id.status_message); + break; + case SENT: + view = activity.getLayoutInflater().inflate(R.layout.message_sent, parent, false); + viewHolder.message_box = view.findViewById(R.id.message_box); + viewHolder.contact_picture = view.findViewById(R.id.message_photo); + viewHolder.audioPlayer = view.findViewById(R.id.audio_player); + viewHolder.download_button = view.findViewById(R.id.download_button); + viewHolder.resend_button = view.findViewById(R.id.resend_button); + viewHolder.indicator = view.findViewById(R.id.security_indicator); + viewHolder.edit_indicator = view.findViewById(R.id.edit_indicator); + viewHolder.image = view.findViewById(R.id.message_image); + viewHolder.messageBody = view.findViewById(R.id.message_body); + viewHolder.time = view.findViewById(R.id.message_time); + viewHolder.indicatorReceived = view.findViewById(R.id.indicator_received); + viewHolder.indicatorRead = view.findViewById(R.id.indicator_read); + break; + case RECEIVED: + view = activity.getLayoutInflater().inflate(R.layout.message_received, parent, false); + viewHolder.message_box = view.findViewById(R.id.message_box); + viewHolder.contact_picture = view.findViewById(R.id.message_photo); + viewHolder.audioPlayer = view.findViewById(R.id.audio_player); + viewHolder.download_button = view.findViewById(R.id.download_button); + viewHolder.indicator = view.findViewById(R.id.security_indicator); + viewHolder.edit_indicator = view.findViewById(R.id.edit_indicator); + viewHolder.image = view.findViewById(R.id.message_image); + viewHolder.messageBody = view.findViewById(R.id.message_body); + viewHolder.time = view.findViewById(R.id.message_time); + viewHolder.indicatorReceived = view.findViewById(R.id.indicator_received); + viewHolder.encryption = view.findViewById(R.id.message_encryption); + break; + case STATUS: + view = activity.getLayoutInflater().inflate(R.layout.message_status, parent, false); + viewHolder.contact_picture = view.findViewById(R.id.message_photo); + viewHolder.status_message = view.findViewById(R.id.status_message); + viewHolder.load_more_messages = view.findViewById(R.id.load_more_messages); + break; + default: + throw new AssertionError("Unknown view type"); + } + if (viewHolder.messageBody != null) { + listSelectionManager.onCreate(viewHolder.messageBody, new MessageBodyActionModeCallback(viewHolder.messageBody)); + viewHolder.messageBody.setCopyHandler(this); + } + view.setTag(viewHolder); + } else { + viewHolder = (ViewHolder) view.getTag(); + if (viewHolder == null) { + return view; + } } - boolean darkBackground = false; // default: (type == SENT && (!isInValidSession || !mUseWhiteBackground)); if (type == DATE_SEPARATOR) { @@ -839,9 +841,12 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie viewHolder.load_more_messages.setVisibility(View.GONE); viewHolder.status_message.setText(message.getBody()); boolean showAvatar; - if (conversation.getMode() == Conversation.MODE_MULTI && (message.getCounterpart() != null || message.getTrueCounterpart() != null || (message.getCounterparts() != null && message.getCounterparts().size() > 0))) { + if (conversation.getMode() == Conversation.MODE_SINGLE) { + showAvatar = true; + loadAvatar(message,viewHolder.contact_picture,activity.getPixel(32)); + } else if (message.getCounterpart() != null || message.getTrueCounterpart() != null || (message.getCounterparts() != null && message.getCounterparts().size() > 0)) { showAvatar = true; - loadAvatar(message, viewHolder.contact_picture, activity.getPixel(32)); + loadAvatar(message,viewHolder.contact_picture,activity.getPixel(32)); } else { showAvatar = false; } @@ -1024,7 +1029,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie } public interface OnQuoteListener { - void onQuote(String text); + public void onQuote(String text); } private class MessageBodyActionModeCallback implements ActionMode.Callback { diff --git a/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java b/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java index ce126fa1f..396a71348 100644 --- a/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java +++ b/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java @@ -29,7 +29,7 @@ public class CopyTextView extends TextView { } public interface CopyHandler { - String transformTextForCopy(CharSequence text, int start, int end); + public String transformTextForCopy(CharSequence text, int start, int end); } private CopyHandler copyHandler; diff --git a/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java b/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java index f86357308..5ac6f9134 100644 --- a/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java +++ b/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java @@ -141,7 +141,10 @@ public class ListSelectionManager { @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { - return additionalCallback != null && additionalCallback.onActionItemClicked(mode, item); + if (additionalCallback != null && additionalCallback.onActionItemClicked(mode, item)) { + return true; + } + return false; } @Override diff --git a/src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java b/src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java index 3a55b24a7..f19258dda 100644 --- a/src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java +++ b/src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java @@ -5,5 +5,5 @@ import android.os.Bundle; import java.util.List; public interface OnPhoneContactsLoadedListener { - void onPhoneContactsLoaded(List phoneContacts); + public void onPhoneContactsLoaded(List phoneContacts); } diff --git a/src/main/java/de/pixart/messenger/utils/UIHelper.java b/src/main/java/de/pixart/messenger/utils/UIHelper.java index 617044f43..9e0a571b0 100644 --- a/src/main/java/de/pixart/messenger/utils/UIHelper.java +++ b/src/main/java/de/pixart/messenger/utils/UIHelper.java @@ -236,10 +236,7 @@ public class UIHelper { return new Pair<>(getFileDescriptionString(context, message), true); } } else { - String body = message.getBody(); - if (body.length() > 256) { - body = body.substring(0, 256); - } + final String body = message.getBody(); if (body.startsWith(Message.ME_COMMAND)) { return new Pair<>(body.replaceAll("^" + Message.ME_COMMAND, UIHelper.getMessageDisplayName(message) + " "), false); @@ -520,9 +517,9 @@ public class UIHelper { field.setAccessible(true); Object menuPopupHelper = field.get(attachFilePopup); Class cls = Class.forName("com.android.internal.view.menu.MenuPopupHelper"); - Method method = cls.getDeclaredMethod("setForceShowIcon", boolean.class); + Method method = cls.getDeclaredMethod("setForceShowIcon", new Class[]{boolean.class}); method.setAccessible(true); - method.invoke(menuPopupHelper, true); + method.invoke(menuPopupHelper, new Object[]{true}); return true; } catch (Exception e) { return false; diff --git a/src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java b/src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java index 788370e41..3ca11c068 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java @@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp; import de.pixart.messenger.entities.Account; public interface OnAdvancedStreamFeaturesLoaded { - void onAdvancedStreamFeaturesAvailable(final Account account); + public void onAdvancedStreamFeaturesAvailable(final Account account); } diff --git a/src/main/java/de/pixart/messenger/xmpp/OnBindListener.java b/src/main/java/de/pixart/messenger/xmpp/OnBindListener.java index 4c81adb68..710a807dd 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnBindListener.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnBindListener.java @@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp; import de.pixart.messenger.entities.Account; public interface OnBindListener { - void onBind(Account account); + public void onBind(Account account); } diff --git a/src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java b/src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java index fa99b4964..66cd24858 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java @@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp; import de.pixart.messenger.entities.Contact; public interface OnContactStatusChanged { - void onContactStatusChanged(final Contact contact, final boolean online); + public void onContactStatusChanged(final Contact contact, final boolean online); } diff --git a/src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java b/src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java index d55fb6890..925a2544d 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java @@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp; import de.pixart.messenger.crypto.axolotl.AxolotlService; public interface OnKeyStatusUpdated { - void onKeyStatusUpdated(AxolotlService.FetchStatus report); + public void onKeyStatusUpdated(AxolotlService.FetchStatus report); } diff --git a/src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java b/src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java index 6b9cf7c1d..7ff5658a8 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java @@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp; import de.pixart.messenger.entities.Account; public interface OnMessageAcknowledged { - void onMessageAcknowledged(Account account, String id); + public void onMessageAcknowledged(Account account, String id); } diff --git a/src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java b/src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java index 6c2af70fe..d4d54f8df 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java @@ -4,5 +4,5 @@ import de.pixart.messenger.entities.Account; import de.pixart.messenger.xmpp.stanzas.MessagePacket; public interface OnMessagePacketReceived extends PacketReceived { - void onMessagePacketReceived(Account account, MessagePacket packet); + public void onMessagePacketReceived(Account account, MessagePacket packet); } diff --git a/src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java b/src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java index 53160d4d0..2df725ff7 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java @@ -4,5 +4,5 @@ import de.pixart.messenger.entities.Account; import de.pixart.messenger.xmpp.stanzas.PresencePacket; public interface OnPresencePacketReceived extends PacketReceived { - void onPresencePacketReceived(Account account, PresencePacket packet); + public void onPresencePacketReceived(Account account, PresencePacket packet); } diff --git a/src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java b/src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java index 8e86d5dcb..40b7b313a 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java @@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp; import de.pixart.messenger.entities.Account; public interface OnStatusChanged { - void onStatusChanged(Account account); + public void onStatusChanged(Account account); } diff --git a/src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java b/src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java index 981c79388..3f6605025 100644 --- a/src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java +++ b/src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java @@ -3,11 +3,11 @@ package de.pixart.messenger.xmpp; public interface OnUpdateBlocklist { // Use an enum instead of a boolean to make sure we don't run into the boolean trap // (`onUpdateBlocklist(true)' doesn't read well, and could be confusing). - enum Status { + public enum Status { BLOCKED, UNBLOCKED } @SuppressWarnings("MethodNameSameAsClassName") - void OnUpdateBlocklist(final Status status); + public void OnUpdateBlocklist(final Status status); } diff --git a/src/main/java/de/pixart/messenger/xmpp/PacketReceived.java b/src/main/java/de/pixart/messenger/xmpp/PacketReceived.java index a39ba4549..b5b02b147 100644 --- a/src/main/java/de/pixart/messenger/xmpp/PacketReceived.java +++ b/src/main/java/de/pixart/messenger/xmpp/PacketReceived.java @@ -1,5 +1,5 @@ package de.pixart.messenger.xmpp; -public interface PacketReceived { +public abstract interface PacketReceived { } diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java b/src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java index bb8bf98a0..11a3eed5e 100644 --- a/src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java +++ b/src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java @@ -1,7 +1,7 @@ package de.pixart.messenger.xmpp.jingle; public interface OnTransportConnected { - void failed(); + public void failed(); - void established(); + public void established(); } -- cgit v1.2.3