aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/AndroidManifest.xml5
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java3
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/PgpEngine.java12
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Message.java2
-rw-r--r--src/main/java/eu/siacs/conversations/entities/MucOptions.java27
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java3
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/FileBackend.java24
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java76
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java10
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java9
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java21
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java6
-rw-r--r--src/main/java/eu/siacs/conversations/utils/UIHelper.java21
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java2
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java2
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java2
16 files changed, 91 insertions, 134 deletions
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index 32545985..fb5df34d 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -39,7 +39,6 @@
<activity
android:name=".ui.ConversationActivity"
android:label="@string/app_name"
- android:configChanges="orientation|screenSize"
android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden">
<intent-filter>
@@ -91,22 +90,18 @@
android:label="@string/change_password_on_server"/>
<activity
android:name=".ui.ManageAccountActivity"
- android:configChanges="orientation|screenSize"
android:label="@string/title_activity_manage_accounts"
android:launchMode="singleTask"/>
<activity
android:name=".ui.EditAccountActivity"
- android:configChanges="orientation|screenSize"
android:launchMode="singleTask"
android:windowSoftInputMode="stateHidden|adjustResize"/>
<activity
android:name=".ui.ConferenceDetailsActivity"
- android:configChanges="orientation|screenSize"
android:label="@string/title_activity_conference_details"
android:windowSoftInputMode="stateHidden"/>
<activity
android:name=".ui.ContactDetailsActivity"
- android:configChanges="orientation|screenSize"
android:label="@string/title_activity_contact_details"
android:windowSoftInputMode="stateHidden"/>
<activity
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index 14605cf0..046dd0d5 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -37,7 +37,8 @@ public final class Config {
public static final int REFRESH_UI_INTERVAL = 500;
- public static final boolean NO_PROXY_LOOKUP = false; //useful to debug ibb
+ public static final boolean DISABLE_PROXY_LOOKUP = false; //useful to debug ibb
+ public static final boolean DISABLE_HTTP_UPLOAD = false;
public static final boolean DISABLE_STRING_PREP = false; // setting to true might increase startup performance
public static final boolean EXTENDED_SM_LOGGING = true; // log stanza counts
public static final boolean RESET_ATTEMPT_COUNT_ON_NETWORK_CHANGE = true; //setting to true might increase power consumption
diff --git a/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java b/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
index f25a8c93..797a75b0 100644
--- a/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
+++ b/src/main/java/eu/siacs/conversations/crypto/PgpEngine.java
@@ -24,6 +24,7 @@ import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.DownloadableFile;
import eu.siacs.conversations.entities.Message;
import eu.siacs.conversations.http.HttpConnectionManager;
+import eu.siacs.conversations.persistance.FileBackend;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.ui.UiCallback;
@@ -96,6 +97,7 @@ public class PgpEngine {
@Override
public void onReturn(Intent result) {
+ notifyPgpDecryptionService(message.getConversation().getAccount(), OpenPgpApi.ACTION_DECRYPT_VERIFY, result);
switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,
OpenPgpApi.RESULT_CODE_ERROR)) {
case OpenPgpApi.RESULT_CODE_SUCCESS:
@@ -196,8 +198,8 @@ public class PgpEngine {
.getFileBackend().getFile(message, false);
outputFile.getParentFile().mkdirs();
outputFile.createNewFile();
- InputStream is = new FileInputStream(inputFile);
- OutputStream os = new FileOutputStream(outputFile);
+ final InputStream is = new FileInputStream(inputFile);
+ final OutputStream os = new FileOutputStream(outputFile);
api.executeApiAsync(params, is, os, new IOpenPgpCallback() {
@Override
@@ -206,6 +208,12 @@ public class PgpEngine {
switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,
OpenPgpApi.RESULT_CODE_ERROR)) {
case OpenPgpApi.RESULT_CODE_SUCCESS:
+ try {
+ os.flush();
+ } catch (IOException ignored) {
+ //ignored
+ }
+ FileBackend.close(os);
callback.success(message);
break;
case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java
index 808bb1b6..1eafa45f 100644
--- a/src/main/java/eu/siacs/conversations/entities/Message.java
+++ b/src/main/java/eu/siacs/conversations/entities/Message.java
@@ -523,7 +523,7 @@ public class Message extends AbstractEntity {
String extension = filename.substring(dotPosition + 1);
// we want the real file extension, not the crypto one
if (Arrays.asList(Transferable.VALID_CRYPTO_EXTENSIONS).contains(extension)) {
- return extractRelevantExtension(path.substring(0,dotPosition));
+ return extractRelevantExtension(filename.substring(0,dotPosition));
} else {
return extension;
}
diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
index dc070164..f8fb0bf4 100644
--- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
@@ -107,10 +107,6 @@ public class MucOptions {
}
- public interface OnJoinListener extends OnEventListener {
-
- }
-
public class User {
private Role role = Role.NONE;
private Affiliation affiliation = Affiliation.NONE;
@@ -215,7 +211,6 @@ public class MucOptions {
private boolean isOnline = false;
private int error = ERROR_UNKNOWN;
private OnRenameListener onRenameListener = null;
- private OnJoinListener onJoinListener = null;
private User self = new User();
private String subject = null;
private String password = null;
@@ -317,9 +312,6 @@ public class MucOptions {
onRenameListener.onSuccess();
}
mNickChangingInProgress = false;
- } else if (this.onJoinListener != null) {
- this.onJoinListener.onSuccess();
- this.onJoinListener = null;
}
} else {
addUser(user);
@@ -328,14 +320,11 @@ public class MucOptions {
Element signed = packet.findChild("x", "jabber:x:signed");
if (signed != null) {
Element status = packet.findChild("status");
- String msg;
- if (status != null) {
- msg = status.getContent();
- } else {
- msg = "";
+ String msg = status == null ? "" : status.getContent();
+ long keyId = pgp.fetchKeyId(account, msg, signed.getContent());
+ if (keyId != 0) {
+ user.setPgpKeyId(keyId);
}
- user.setPgpKeyId(pgp.fetchKeyId(account, msg,
- signed.getContent()));
}
}
}
@@ -381,10 +370,6 @@ public class MucOptions {
private void setError(int error) {
this.isOnline = false;
this.error = error;
- if (onJoinListener != null) {
- onJoinListener.onFailure();
- onJoinListener = null;
- }
}
private List<String> getStatusCodes(Element x) {
@@ -438,10 +423,6 @@ public class MucOptions {
this.onRenameListener = listener;
}
- public void setOnJoinListener(OnJoinListener listener) {
- this.onJoinListener = listener;
- }
-
public void setOffline() {
this.users.clear();
this.error = 0;
diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
index 792a71e8..96dee62c 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java
@@ -125,6 +125,9 @@ public class HttpDownloadConnection implements Transferable {
mXmppConnectionService.sendBroadcast(intent);
message.setTransferable(null);
mHttpConnectionManager.finishConnection(this);
+ if (message.getEncryption() == Message.ENCRYPTION_PGP) {
+ message.getConversation().getAccount().getPgpDecryptionService().add(message);
+ }
mXmppConnectionService.updateConversationUi();
if (acceptedAutomatically) {
mXmppConnectionService.getNotificationService().push(message);
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
index edbcd26e..349e18c7 100644
--- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
@@ -61,22 +61,26 @@ public class FileBackend {
final boolean encrypted = !decrypted
&& (message.getEncryption() == Message.ENCRYPTION_PGP
|| message.getEncryption() == Message.ENCRYPTION_DECRYPTED);
- if (encrypted) {
- return new DownloadableFile(getConversationsFileDirectory()+message.getUuid()+".pgp");
+ final DownloadableFile file;
+ String path = message.getRelativeFilePath();
+ if (path == null) {
+ path = message.getUuid();
+ }
+ if (path.startsWith("/")) {
+ file = new DownloadableFile(path);
} else {
- String path = message.getRelativeFilePath();
- if (path == null) {
- path = message.getUuid();
- } else if (path.startsWith("/")) {
- return new DownloadableFile(path);
- }
String mime = message.getMimeType();
if (mime != null && mime.startsWith("image")) {
- return new DownloadableFile(getConversationsImageDirectory() + path);
+ file = new DownloadableFile(getConversationsImageDirectory() + path);
} else {
- return new DownloadableFile(getConversationsFileDirectory() + path);
+ file = new DownloadableFile(getConversationsFileDirectory() + path);
}
}
+ if (encrypted) {
+ return new DownloadableFile(getConversationsFileDirectory() + file.getName() + ".pgp");
+ } else {
+ return file;
+ }
}
public static String getConversationsFileDirectory() {
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 27a7eee3..96da5026 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1688,16 +1688,16 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
List<Conversation> conversations = getConversations();
for (Conversation conversation : conversations) {
if (conversation.getMode() == Conversation.MODE_MULTI && conversation.getAccount() == account) {
- joinMuc(conversation, true);
+ joinMuc(conversation, true, null);
}
}
}
public void joinMuc(Conversation conversation) {
- joinMuc(conversation, false);
+ joinMuc(conversation, false, null);
}
- private void joinMuc(Conversation conversation, boolean now) {
+ private void joinMuc(Conversation conversation, boolean now, final OnConferenceJoined onConferenceJoined) {
Account account = conversation.getAccount();
account.pendingConferenceJoins.remove(conversation);
account.pendingConferenceLeaves.remove(conversation);
@@ -1730,11 +1730,13 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
}
String sig = account.getPgpSignature();
if (sig != null) {
- packet.addChild("status").setContent("online");
packet.addChild("x", "jabber:x:signed").setContent(sig);
}
sendPresencePacket(account, packet);
fetchConferenceConfiguration(conversation);
+ if (onConferenceJoined != null) {
+ onConferenceJoined.onConferenceJoined(conversation);
+ }
if (!joinJid.equals(conversation.getJid())) {
conversation.setContactJid(joinJid);
databaseBackend.updateConversation(conversation);
@@ -1752,17 +1754,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
@Override
public void onFetchFailed(final Conversation conversation, Element error) {
- conversation.getMucOptions().setOnJoinListener(new MucOptions.OnJoinListener() {
- @Override
- public void onSuccess() {
- fetchConferenceConfiguration(conversation);
- }
-
- @Override
- public void onFailure() {
-
- }
- });
join(conversation);
}
});
@@ -1889,34 +1880,37 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
String name = new BigInteger(75, getRNG()).toString(32);
Jid jid = Jid.fromParts(name, server, null);
final Conversation conversation = findOrCreateConversation(account, jid, true);
- joinMuc(conversation);
- Bundle options = new Bundle();
- options.putString("muc#roomconfig_persistentroom", "1");
- options.putString("muc#roomconfig_membersonly", "1");
- options.putString("muc#roomconfig_publicroom", "0");
- options.putString("muc#roomconfig_whois", "anyone");
- pushConferenceConfiguration(conversation, options, new OnConferenceOptionsPushed() {
+ joinMuc(conversation, true, new OnConferenceJoined() {
@Override
- public void onPushSucceeded() {
- for (Jid invite : jids) {
- invite(conversation, invite);
- }
- if (account.countPresences() > 1) {
- directInvite(conversation, account.getJid().toBareJid());
- }
- if (callback != null) {
- callback.success(conversation);
- }
- }
+ public void onConferenceJoined(final Conversation conversation) {
+ Bundle options = new Bundle();
+ options.putString("muc#roomconfig_persistentroom", "1");
+ options.putString("muc#roomconfig_membersonly", "1");
+ options.putString("muc#roomconfig_publicroom", "0");
+ options.putString("muc#roomconfig_whois", "anyone");
+ pushConferenceConfiguration(conversation, options, new OnConferenceOptionsPushed() {
+ @Override
+ public void onPushSucceeded() {
+ for (Jid invite : jids) {
+ invite(conversation, invite);
+ }
+ if (account.countPresences() > 1) {
+ directInvite(conversation, account.getJid().toBareJid());
+ }
+ if (callback != null) {
+ callback.success(conversation);
+ }
+ }
- @Override
- public void onPushFailed() {
- if (callback != null) {
- callback.error(R.string.conference_creation_failed, conversation);
- }
+ @Override
+ public void onPushFailed() {
+ if (callback != null) {
+ callback.error(R.string.conference_creation_failed, conversation);
+ }
+ }
+ });
}
});
-
} catch (InvalidJidException e) {
if (callback != null) {
callback.error(R.string.conference_creation_failed, null);
@@ -2976,6 +2970,10 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
void onFetchFailed(Conversation conversation, Element error);
}
+ public interface OnConferenceJoined {
+ void onConferenceJoined(Conversation conversation);
+ }
+
public interface OnConferenceOptionsPushed {
void onPushSucceeded();
diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
index 20195256..42ce5349 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
@@ -6,7 +6,6 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.IntentSender.SendIntentException;
-import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
@@ -42,7 +41,6 @@ import eu.siacs.conversations.entities.MucOptions.User;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.services.XmppConnectionService.OnConversationUpdate;
import eu.siacs.conversations.services.XmppConnectionService.OnMucRosterUpdate;
-import eu.siacs.conversations.utils.UIHelper;
import eu.siacs.conversations.xmpp.jid.Jid;
public class ConferenceDetailsActivity extends XmppActivity implements OnConversationUpdate, OnMucRosterUpdate, XmppConnectionService.OnAffiliationChanged, XmppConnectionService.OnRoleChanged, XmppConnectionService.OnConferenceOptionsPushed {
@@ -55,7 +53,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
inviteToConversation(mConversation);
}
};
- private LinearLayout mMainLayout;
private TextView mYourNick;
private ImageView mYourPhoto;
private ImageButton mEditNickButton;
@@ -190,7 +187,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_muc_details);
- mMainLayout = (LinearLayout) findViewById(R.id.muc_main_layout);
mYourNick = (TextView) findViewById(R.id.muc_your_nick);
mYourPhoto = (ImageView) findViewById(R.id.your_photo);
mEditNickButton = (ImageButton) findViewById(R.id.edit_nick_button);
@@ -454,12 +450,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
}
}
- @Override
- public void onConfigurationChanged (Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- UIHelper.resetChildMargins(mMainLayout);
- }
-
private void updateView() {
final MucOptions mucOptions = mConversation.getMucOptions();
final User self = mucOptions.getSelf();
diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
index ebac6feb..10bdaab1 100644
--- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
@@ -7,7 +7,6 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender.SendIntentException;
import android.content.SharedPreferences;
-import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
@@ -100,7 +99,6 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
}
}
};
- private LinearLayout mainLayout;
private Jid accountJid;
private Jid contactJid;
private TextView contactJidTv;
@@ -199,7 +197,6 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
this.messageFingerprint = getIntent().getStringExtra("fingerprint");
setContentView(R.layout.activity_contact_details);
- mainLayout = (LinearLayout) findViewById(R.id.details_main_layout);
contactJidTv = (TextView) findViewById(R.id.details_contactjid);
accountJidTv = (TextView) findViewById(R.id.details_account);
lastseen = (TextView) findViewById(R.id.details_lastseen);
@@ -300,12 +297,6 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
return true;
}
- @Override
- public void onConfigurationChanged (Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- UIHelper.resetChildMargins(mainLayout);
- }
-
private void populateView() {
invalidateOptionsMenu();
setTitle(contact.getDisplayName());
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 80b054a4..5c772220 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -17,6 +17,7 @@ import android.provider.MediaStore;
import android.support.v4.widget.SlidingPaneLayout;
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
import android.util.Log;
+import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
@@ -510,22 +511,22 @@ public class ConversationActivity extends XmppActivity
}
final Conversation conversation = getSelectedConversation();
final int encryption = conversation.getNextEncryption();
+ final int mode = conversation.getMode();
if (encryption == Message.ENCRYPTION_PGP) {
if (hasPgp()) {
- if (conversation.getContact().getPgpKeyId() != 0) {
+ if (mode == Conversation.MODE_SINGLE && conversation.getContact().getPgpKeyId() != 0) {
xmppConnectionService.getPgpEngine().hasKey(
conversation.getContact(),
new UiCallback<Contact>() {
@Override
- public void userInputRequried(PendingIntent pi,
- Contact contact) {
- ConversationActivity.this.runIntent(pi,attachmentChoice);
+ public void userInputRequried(PendingIntent pi, Contact contact) {
+ ConversationActivity.this.runIntent(pi, attachmentChoice);
}
@Override
public void success(Contact contact) {
- selectPresenceToAttachFile(attachmentChoice,encryption);
+ selectPresenceToAttachFile(attachmentChoice, encryption);
}
@Override
@@ -533,6 +534,16 @@ public class ConversationActivity extends XmppActivity
displayErrorDialog(error);
}
});
+ } else if (mode == Conversation.MODE_MULTI && conversation.getMucOptions().pgpKeysInUse()) {
+ if (!conversation.getMucOptions().everybodyHasKeys()) {
+ Toast warning = Toast
+ .makeText(this,
+ R.string.missing_public_keys,
+ Toast.LENGTH_LONG);
+ warning.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+ warning.show();
+ }
+ selectPresenceToAttachFile(attachmentChoice, encryption);
} else {
final ConversationFragment fragment = (ConversationFragment) getFragmentManager()
.findFragmentByTag("conversation");
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
index 180fc8b8..5fe5848c 100644
--- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -483,12 +483,6 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
}
@Override
- public void onConfigurationChanged (Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- UIHelper.resetChildMargins(mMainLayout);
- }
-
- @Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.action_show_block_list:
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
index 8a73d35f..cac23f07 100644
--- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
@@ -3,11 +3,7 @@ package eu.siacs.conversations.utils;
import android.content.Context;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
-import android.util.DisplayMetrics;
import android.util.Pair;
-import android.view.View;
-import android.widget.LinearLayout;
-import android.widget.RelativeLayout;
import java.util.ArrayList;
import java.util.Arrays;
@@ -265,21 +261,4 @@ public class UIHelper {
body = body.replace("?","").replace("¿","");
return LOCATION_QUESTIONS.contains(body);
}
-
- public static void resetChildMargins(LinearLayout view) {
- int childCount = view.getChildCount();
- for (int i = 0; i < childCount; i++) {
- UIHelper.resetMargins(view.getChildAt(i));
- }
- }
-
- private static void resetMargins(View view) {
- LinearLayout.MarginLayoutParams marginLayoutParams = new LinearLayout.MarginLayoutParams(view.getLayoutParams());
- marginLayoutParams.setMargins(view.getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin),
- view.getResources().getDimensionPixelSize(R.dimen.activity_vertical_margin),
- view.getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin),
- view.getResources().getDimensionPixelSize(R.dimen.activity_vertical_margin));
- LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(marginLayoutParams);
- view.setLayoutParams(layoutParams);
- }
}
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 7092aca1..c28ac039 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -1369,7 +1369,7 @@ public class XmppConnection implements Runnable {
}
public boolean httpUpload() {
- return findDiscoItemsByFeature(Xmlns.HTTP_UPLOAD).size() > 0;
+ return !Config.DISABLE_HTTP_UPLOAD && findDiscoItemsByFeature(Xmlns.HTTP_UPLOAD).size() > 0;
}
}
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
index 388c5dec..4510bca2 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
@@ -114,6 +114,8 @@ public class JingleConnection implements Transferable {
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
intent.setData(Uri.fromFile(file));
mXmppConnectionService.sendBroadcast(intent);
+ } else {
+ account.getPgpDecryptionService().add(message);
}
}
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java
index ab564480..0f0361cd 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java
@@ -83,7 +83,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
public void getPrimaryCandidate(Account account,
final OnPrimaryCandidateFound listener) {
- if (Config.NO_PROXY_LOOKUP) {
+ if (Config.DISABLE_PROXY_LOOKUP) {
listener.onPrimaryCandidateFound(false, null);
return;
}