aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2015-08-15 19:43:23 +0200
committerChristian S <christian@pix-art.de>2015-08-15 19:43:23 +0200
commita118cb0e5ee7859aee683f1c49ac125848798cc4 (patch)
tree08ae5551a3ff21ced678e2aa1e62800af5785639 /src
parentc387495146f3eaf10978365c65099f8f54107257 (diff)
parent11fbc3d79e5896a4ba7d7e0c0c68415824c7b8cd (diff)
version 1.6.0
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java2
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/FileBackend.java10
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java3
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java7
-rw-r--r--src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java10
-rw-r--r--src/main/res/layout/activity_edit_account.xml20
-rw-r--r--src/main/res/layout/activity_trust_keys.xml32
-rw-r--r--src/main/res/values/strings.xml7
8 files changed, 88 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index 5786487f2..025ed1e7e 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -476,4 +476,4 @@ public class MessageParser extends AbstractParser implements
contact.setPresenceName(nick);
}
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
index 7fd5d88b8..d610fcab8 100644
--- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
@@ -22,6 +22,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.net.Socket;
import java.net.URL;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
@@ -557,4 +558,13 @@ public class FileBackend {
}
}
}
+
+ public static void close(Socket socket) {
+ if (socket != null) {
+ try {
+ socket.close();
+ } catch (IOException e) {
+ }
+ }
+ }
}
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index ed3bb8792..a9a2f2117 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -280,9 +280,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
scheduleWakeUpCall(Config.PING_MAX_INTERVAL, account.getUuid().hashCode());
} else if (account.getStatus() == Account.State.OFFLINE) {
- resetSendingToWaiting(account);
if (!account.isOptionSet(Account.OPTION_DISABLED)) {
- int timeToReconnect = mRandom.nextInt(50) + 10;
+ int timeToReconnect = mRandom.nextInt(20) + 10;
scheduleWakeUpCall(timeToReconnect,account.getUuid().hashCode());
}
} else if (account.getStatus() == Account.State.REGISTRATION_SUCCESSFUL) {
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
index 59e2dc266..206b1864b 100644
--- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -60,6 +60,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
private TextView mServerInfoCSI;
private TextView mServerInfoBlocking;
private TextView mServerInfoPep;
+ private TextView mServerInfoHttpUpload;
private TextView mSessionEst;
private TextView mOtrFingerprint;
private TextView mAxolotlFingerprint;
@@ -347,6 +348,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
this.mServerInfoBlocking = (TextView) findViewById(R.id.server_info_blocking);
this.mServerInfoSm = (TextView) findViewById(R.id.server_info_sm);
this.mServerInfoPep = (TextView) findViewById(R.id.server_info_pep);
+ this.mServerInfoHttpUpload = (TextView) findViewById(R.id.server_info_http_upload);
this.mOtrFingerprint = (TextView) findViewById(R.id.otr_fingerprint);
this.mOtrFingerprintBox = (RelativeLayout) findViewById(R.id.otr_fingerprint_box);
this.mOtrFingerprintToClipboardButton = (ImageButton) findViewById(R.id.action_copy_to_clipboard);
@@ -542,6 +544,11 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
} else {
this.mServerInfoPep.setText(R.string.server_info_unavailable);
}
+ if (features.httpUpload()) {
+ this.mServerInfoHttpUpload.setText(R.string.server_info_available);
+ } else {
+ this.mServerInfoHttpUpload.setText(R.string.server_info_unavailable);
+ }
final String otrFingerprint = this.mAccount.getOtrFingerprint();
if (otrFingerprint != null) {
this.mOtrFingerprintBox.setVisibility(View.VISIBLE);
diff --git a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java
index cf22416fb..0e685c3ee 100644
--- a/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/TrustKeysActivity.java
@@ -32,6 +32,8 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
private boolean hasNoTrustedKeys = true;
private Contact contact;
+ private TextView keyErrorMessage;
+ private LinearLayout keyErrorMessageCard;
private TextView ownKeysTitle;
private LinearLayout ownKeys;
private LinearLayout ownKeysCard;
@@ -92,6 +94,8 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
}
hasNoTrustedKeys = getIntent().getBooleanExtra("has_no_trusted", false);
+ keyErrorMessageCard = (LinearLayout) findViewById(R.id.key_error_message_card);
+ keyErrorMessage = (TextView) findViewById(R.id.key_error_message);
ownKeysTitle = (TextView) findViewById(R.id.own_keys_title);
ownKeys = (LinearLayout) findViewById(R.id.own_keys_details);
ownKeysCard = (LinearLayout) findViewById(R.id.own_keys_card);
@@ -157,6 +161,12 @@ public class TrustKeysActivity extends XmppActivity implements OnKeyStatusUpdate
setFetching();
lock();
} else {
+ if (!hasForeignKeys && !hasOtherTrustedKeys) {
+ keyErrorMessageCard.setVisibility(View.VISIBLE);
+ keyErrorMessage.setText(R.string.error_no_keys_to_trust);
+ ownKeys.removeAllViews(); ownKeysCard.setVisibility(View.GONE);
+ foreignKeys.removeAllViews(); foreignKeysCard.setVisibility(View.GONE);
+ }
lockOrUnlockAsNeeded();
setDone();
}
diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml
index 4599b3a2f..bcbe7a7fb 100644
--- a/src/main/res/layout/activity_edit_account.xml
+++ b/src/main/res/layout/activity_edit_account.xml
@@ -309,6 +309,26 @@
android:textSize="?attr/TextSizeBody"
tools:ignore="RtlHardcoded"/>
</TableRow>
+ <TableRow
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/server_info_http_upload"
+ android:textColor="@color/black87"
+ android:textSize="?attr/TextSizeBody" />
+
+ <TextView
+ android:id="@+id/server_info_http_upload"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:textColor="@color/black87"
+ android:textSize="?attr/TextSizeBody"
+ tools:ignore="RtlHardcoded"/>
+ </TableRow>
</TableLayout>
<RelativeLayout
diff --git a/src/main/res/layout/activity_trust_keys.xml b/src/main/res/layout/activity_trust_keys.xml
index c535d51df..6f8a1bc9c 100644
--- a/src/main/res/layout/activity_trust_keys.xml
+++ b/src/main/res/layout/activity_trust_keys.xml
@@ -16,6 +16,38 @@
android:orientation="vertical">
<LinearLayout
+ android:id="@+id/key_error_message_card"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="@dimen/activity_horizontal_margin"
+ android:layout_marginRight="@dimen/activity_horizontal_margin"
+ android:layout_marginTop="@dimen/activity_vertical_margin"
+ android:layout_marginBottom="@dimen/activity_vertical_margin"
+ android:background="@drawable/infocard_border"
+ android:orientation="vertical"
+ android:padding="@dimen/infocard_padding"
+ android:visibility="gone">
+
+ <TextView
+ android:id="@+id/key_error_message_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/black87"
+ android:textSize="?attr/TextSizeHeadline"
+ android:textStyle="bold"
+ android:text="@string/error_trustkeys_title"/>
+
+ <TextView
+ android:id="@+id/key_error_message"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/black87"
+ android:textSize="?attr/TextSizeBody"
+ android:padding="8dp"/>
+
+ </LinearLayout>
+
+ <LinearLayout
android:id="@+id/own_keys_card"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index b01c62177..d1d593476 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -191,6 +191,7 @@
<string name="server_info_roster_version">XEP-0237: Roster Versioning</string>
<string name="server_info_stream_management">XEP-0198: Stream Management</string>
<string name="server_info_pep">XEP-0163: PEP (Avatars)</string>
+ <string name="server_info_http_upload">XEP-xxxx: HTTP File Upload</string>
<string name="server_info_available">available</string>
<string name="server_info_unavailable">unavailable</string>
<string name="missing_public_keys">Missing public key announcements</string>
@@ -305,6 +306,10 @@
\n\nhttps://github.com/zxing/zxing\n(Apache License, Version 2.0)
\n\nhttps://github.com/google/material-design-icons\n(CC BY 4.0)
\n\nhttps://github.com/timroes/EnhancedListView\n(Apache License, Version 2.0)
+ \n\nhttps://github.com/leolin310148/ShortcutBadger\n(Apache License, Version 2.0)
+ \n\nhttps://github.com/kyleduo/SwitchButton\n(Apache License, Version 2.0)
+ \n\nhttps://github.com/WhisperSystems/libaxolotl-java\n(GPLv3)
+ \n\nhttps://github.com/vinc3m1/RoundedImageView\n(Apache License, Version 2.0)
</string>
<string name="title_pref_quiet_hours">Quiet Hours</string>
<string name="title_pref_quiet_hours_start_time">Start time</string>
@@ -396,6 +401,8 @@
<string name="purge_key">Purge key</string>
<string name="purge_key_desc_part1">Are you sure you want to purge this key?</string>
<string name="purge_key_desc_part2">It will irreversibly be considered compromised, and you can never build a session with it again.</string>
+ <string name="error_no_keys_to_trust">There are no usable keys available for this contact. If you have purged any of their keys, they need to generate new ones.</string>
+ <string name="error_trustkeys_title">Error</string>
<string name="fetching_history_from_server">Fetching history from server</string>
<string name="no_more_history_on_server">No more history on server</string>
<string name="updating">Updating…</string>