~singpolyma/cheogram-android

495537d087c346076fa4ff58dff927d2a9a348e2 — Daniel Gultsch 2 years ago 20e4d10
minor code cleanup in UriHandlerActivity
1 files changed, 10 insertions(+), 9 deletions(-)

M src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java
M src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java => src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java +10 -9
@@ 147,13 147,7 @@ public class UriHandlerActivity extends AppCompatActivity {
            final String body = xmppUri.getBody();

            if (jid != null) {
                Class clazz;
                try {
                    clazz = Class.forName("eu.siacs.conversations.ui.ShareViaAccountActivity");
                } catch (ClassNotFoundException e) {
                    clazz = null;

                }
                final Class<?> clazz = findShareViaAccountClass();
                if (clazz != null) {
                    intent = new Intent(this, clazz);
                    intent.putExtra("contact", jid.toEscapedString());


@@ 164,7 158,6 @@ public class UriHandlerActivity extends AppCompatActivity {
                    intent.setData(uri);
                    intent.putExtra("account", accounts.get(0).toEscapedString());
                }

            } else {
                intent = new Intent(this, ShareWithActivity.class);
                intent.setAction(Intent.ACTION_SEND);


@@ 191,6 184,14 @@ public class UriHandlerActivity extends AppCompatActivity {
        startActivity(intent);
    }

    private static Class<?> findShareViaAccountClass() {
        try {
            return Class.forName("eu.siacs.conversations.ui.ShareViaAccountActivity");
        } catch (final ClassNotFoundException e) {
            return null;
        }
    }

    private void handleIntent(Intent data) {
        if (handled) {
            return;


@@ 248,7 249,7 @@ public class UriHandlerActivity extends AppCompatActivity {
    }

    private static boolean looksLikeJsonObject(final String input) {
        final String trimmed = Strings.emptyToNull(input).trim();
        final String trimmed = Strings.nullToEmpty(input).trim();
        return trimmed.charAt(0) == '{' && trimmed.charAt(trimmed.length() - 1) == '}';
    }
}
\ No newline at end of file