diff --git a/CHANGELOG.md b/CHANGELOG.md
index dfc89dc90..6ac520342 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+### Version 2.5.1
+* minor bug fixes
+* Set own OMEMO devices to inactive after not seeing them for 14 days. (was 7 days)
+
### Version 2.5.0
* Added channel search via search.jabbercat.org
* Reworked onboarding screens
diff --git a/build.gradle b/build.gradle
index 51780e213..0b85dd3fb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -81,8 +81,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
- versionCode 326
- versionName "2.5.0"
+ versionCode 327
+ versionName "2.5.1"
archivesBaseName += "-$versionName"
applicationId "eu.sum7.conversations"
resValue "string", "applicationId", applicationId
diff --git a/src/conversations/res/values-eu/strings.xml b/src/conversations/res/values-eu/strings.xml
new file mode 100644
index 000000000..c41df2b88
--- /dev/null
+++ b/src/conversations/res/values-eu/strings.xml
@@ -0,0 +1,9 @@
+
+
+ Hautatu zure XMPP hornitzailea
+ Erabili conversations.im
+ Kontu berria sortu
+ XMPP kontu bat badaukazu dagoeneko? Horrela izan daiteke beste XMPP aplikazio bat erabiltzen baduzu edo Conversations lehenago erabili baduzu. Bestela XMPP kontu berri bat sortu dezakezu oraintxe bertan.\nIradokizuna: email hornitzaile batzuek XMPP kontuak hornitzen dituzte ere.
+ XMPP hornitzailez independientea den bat-bateko mezularitza sare bat da. Aplikazio hau nahi duzun XMPP zerbitzariarekin erabili dezakezu.\nHala ere zure erosotasunerako conversations.im¹-en, Conversationsekin bereziki erabiltzeko egokia den hornitzaile batean, kontu bat sortzea erraz egin dugu.
+
+
\ No newline at end of file
diff --git a/src/conversations/res/values-gl/strings.xml b/src/conversations/res/values-gl/strings.xml
new file mode 100644
index 000000000..ab865b8b1
--- /dev/null
+++ b/src/conversations/res/values-gl/strings.xml
@@ -0,0 +1,9 @@
+
+
+ Escolla o seu provedor XMPP
+ Utilizar conversations.im
+ Crear nova conta
+ Xa posúe unha conta XMPP? Este pode ser o caso se xa está a utilizar outro cliente XMPP ou utilizou Conversations previamente. Se non é así pode crear unha nova conta agora mesmo.\nTruco: Algúns provedores de correo tamén proporcionan contas XMPP.
+ XMPP é unha rede de mensaxería independente do provedor. Pode utilizar este cliente con calquer provedor XMPP da súa elección.\nMais para a súa conveniencia fixemos que fose doado crear unha conta en conversations.im¹; un provedor especialmente axeitado para utilizar con Conversations.
+
+
\ No newline at end of file
diff --git a/src/conversations/res/values-pl/strings.xml b/src/conversations/res/values-pl/strings.xml
new file mode 100644
index 000000000..5c9e961ce
--- /dev/null
+++ b/src/conversations/res/values-pl/strings.xml
@@ -0,0 +1,9 @@
+
+
+ Wybierz dostawcę XMPP
+ Użyj conversations.im
+ Stwórz nowe konto
+ Czy masz już konto XMPP? Tak może być jeśli używasz już innego klienta XMPP lub używałeś już Conversations. Jeśli nie możesz stworzyć nowe konto XMPP teraz.\nPodpowiedź: Niektórzy dostawcy poczty oferują również konta XMPP.
+ XMPP to niezależna od dostawcy sieć komunikacji błyskawicznej. Możesz użyć tego klienta z dowolnym serwerem XMPP.\nDla twojej wygody jednak ułatwiliśmy stworzenie konta na conversations.im¹; dostawcy specjalnie dostosowanego do pracy z Conversations.
+
+
\ No newline at end of file
diff --git a/src/conversations/res/values-pt-rBR/strings.xml b/src/conversations/res/values-pt-rBR/strings.xml
index a2f903bdf..478f6ec85 100644
--- a/src/conversations/res/values-pt-rBR/strings.xml
+++ b/src/conversations/res/values-pt-rBR/strings.xml
@@ -1,4 +1,9 @@
Selecione o seu provedor XMPP
-
\ No newline at end of file
+ Usar o conversations.im
+ Criar uma nova conta
+ Você já possui uma conta XMPP? Esse pode ser o seu caso caso já esteja usando um outro cliente XMPP ou tenha usado o Conversations antes. Caso contrário, você pode criar uma nova conta XMPP agora.\nDica: alguns provedores de e-mail também fornecem contas XMPP.
+ O XMPP é uma rede de mensageria instantânea independente de provedor. Você pode usar esse cliente com qualquer servidor XMPP que você escolher.\nEntretanto, para sua conveniência, nós simplificamos o processo de criação de uma conta em conversations.im¹, um provedor especialmente configurado para se usar com o Conversations.
+
+
\ No newline at end of file
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index 10708b6f9..1e7c879ca 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -94,7 +94,7 @@ public final class Config {
public static final long MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;
- public static final long OMEMO_AUTO_EXPIRY = 7 * MILLISECONDS_IN_DAY;
+ public static final long OMEMO_AUTO_EXPIRY = 14 * MILLISECONDS_IN_DAY;
public static final boolean REMOVE_BROKEN_DEVICES = false;
public static final boolean OMEMO_PADDING = false;
public static final boolean PUT_AUTH_TAG_INTO_KEY = true;
@@ -122,7 +122,7 @@ public final class Config {
public static final int EXPIRY_INTERVAL = 30 * 60 * 1000; // 30 minutes
- public static final String ENABLED_CIPHERS[] = {
+ public static final String[] ENABLED_CIPHERS = {
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA256",
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java
index e960d62d3..02fa07818 100644
--- a/src/main/java/eu/siacs/conversations/entities/Message.java
+++ b/src/main/java/eu/siacs/conversations/entities/Message.java
@@ -3,7 +3,6 @@ package eu.siacs.conversations.entities;
import android.content.ContentValues;
import android.database.Cursor;
import android.graphics.Color;
-import android.support.annotation.ColorInt;
import android.text.SpannableStringBuilder;
import android.util.Log;
@@ -181,35 +180,11 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
}
public static Message fromCursor(Cursor cursor, Conversation conversation) {
- Jid jid;
- try {
- String value = cursor.getString(cursor.getColumnIndex(COUNTERPART));
- if (value != null) {
- jid = Jid.of(value);
- } else {
- jid = null;
- }
- } catch (IllegalArgumentException e) {
- jid = null;
- } catch (IllegalStateException e) {
- return null; // message too long?
- }
- Jid trueCounterpart;
- try {
- String value = cursor.getString(cursor.getColumnIndex(TRUE_COUNTERPART));
- if (value != null) {
- trueCounterpart = Jid.of(value);
- } else {
- trueCounterpart = null;
- }
- } catch (IllegalArgumentException e) {
- trueCounterpart = null;
- }
return new Message(conversation,
cursor.getString(cursor.getColumnIndex(UUID)),
cursor.getString(cursor.getColumnIndex(CONVERSATION)),
- jid,
- trueCounterpart,
+ fromString(cursor.getString(cursor.getColumnIndex(COUNTERPART))),
+ fromString(cursor.getString(cursor.getColumnIndex(TRUE_COUNTERPART))),
cursor.getString(cursor.getColumnIndex(BODY)),
cursor.getLong(cursor.getColumnIndex(TIME_SENT)),
cursor.getInt(cursor.getColumnIndex(ENCRYPTION)),
@@ -229,6 +204,17 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
cursor.getInt(cursor.getColumnIndex(DELETED)) > 0);
}
+ private static Jid fromString(String value) {
+ try {
+ if (value != null) {
+ return Jid.of(value);
+ }
+ } catch (IllegalArgumentException e) {
+ return null;
+ }
+ return null;
+ }
+
public static Message createStatusMessage(Conversation conversation, String body) {
final Message message = new Message(conversation);
message.setType(Message.TYPE_STATUS);
diff --git a/src/main/java/eu/siacs/conversations/http/services/MuclumbusService.java b/src/main/java/eu/siacs/conversations/http/services/MuclumbusService.java
index 5ef557c0f..4f2b8f533 100644
--- a/src/main/java/eu/siacs/conversations/http/services/MuclumbusService.java
+++ b/src/main/java/eu/siacs/conversations/http/services/MuclumbusService.java
@@ -4,9 +4,11 @@ import com.google.common.base.Objects;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import eu.siacs.conversations.services.AvatarService;
+import eu.siacs.conversations.utils.LanguageUtils;
import eu.siacs.conversations.utils.UIHelper;
import retrofit2.Call;
import retrofit2.http.Body;
@@ -35,6 +37,7 @@ public interface MuclumbusService {
public String address;
public String name;
public String description;
+ public String language;
public String getName() {
return name;
@@ -52,6 +55,10 @@ public interface MuclumbusService {
}
}
+ public String getLanguage() {
+ return LanguageUtils.convert(language);
+ }
+
@Override
public int getAvatarBackgroundColor() {
Jid room = getRoom();
diff --git a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
index 8542638ab..15d8e9d11 100644
--- a/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java
@@ -28,10 +28,8 @@ import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -750,14 +748,15 @@ public class DatabaseBackend extends SQLiteOpenHelper {
null, null, Message.TIME_SENT + " DESC",
String.valueOf(limit));
}
- if (cursor.getCount() > 0) {
- cursor.moveToLast();
- do {
- Message message = Message.fromCursor(cursor, conversation);
+ while (cursor.moveToNext()) {
+ try {
+ final Message message = Message.fromCursor(cursor, conversation);
if (message != null) {
- list.add(message);
+ list.add(0, message);
}
- } while (cursor.moveToPrevious());
+ } catch (Exception e) {
+ Log.e(Config.LOGTAG,"unable to restore message");
+ }
}
cursor.close();
return list;
@@ -770,40 +769,6 @@ public class DatabaseBackend extends SQLiteOpenHelper {
return db.rawQuery(SQL, new String[]{FtsUtils.toMatchString(term)});
}
- public Iterable getMessagesIterable(final Conversation conversation) {
- return () -> {
- class MessageIterator implements Iterator {
- private SQLiteDatabase db = getReadableDatabase();
- private String[] selectionArgs = {conversation.getUuid()};
- private Cursor cursor = db.query(Message.TABLENAME, null, Message.CONVERSATION
- + "=?", selectionArgs, null, null, Message.TIME_SENT
- + " ASC", null);
-
- private MessageIterator() {
- cursor.moveToFirst();
- }
-
- @Override
- public boolean hasNext() {
- return !cursor.isAfterLast();
- }
-
- @Override
- public Message next() {
- Message message = Message.fromCursor(cursor, conversation);
- cursor.moveToNext();
- return message;
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
- return new MessageIterator();
- };
- }
-
public List markFileAsDeleted(final File file, final boolean internal) {
SQLiteDatabase db = this.getReadableDatabase();
String selection;
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ChannelSearchResultAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ChannelSearchResultAdapter.java
index 7d1a7c873..03f09f70c 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/ChannelSearchResultAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/ChannelSearchResultAdapter.java
@@ -10,6 +10,8 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import java.util.Locale;
+
import eu.siacs.conversations.R;
import eu.siacs.conversations.databinding.SearchResultItemBinding;
import eu.siacs.conversations.http.services.MuclumbusService;
@@ -38,7 +40,7 @@ public class ChannelSearchResultAdapter extends ListAdapter listener.onChannelSearchResult(searchResult));
diff --git a/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java b/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java
index 1ce695ab3..342867576 100644
--- a/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java
+++ b/src/main/java/eu/siacs/conversations/ui/widget/EditMessage.java
@@ -87,16 +87,20 @@ public class EditMessage extends EmojiWrapperEditText {
}
private void triggerKeyboardEvents(final int length) {
+ final KeyboardListener listener = this.keyboardListener;
+ if (listener == null) {
+ return;
+ }
this.mTypingHandler.removeCallbacks(mTypingTimeout);
this.mTypingHandler.postDelayed(mTypingTimeout, Config.TYPING_TIMEOUT * 1000);
if (!isUserTyping && length > 0) {
this.isUserTyping = true;
- this.keyboardListener.onTypingStarted();
+ listener.onTypingStarted();
} else if (length == 0) {
this.isUserTyping = false;
- this.keyboardListener.onTextDeleted();
+ listener.onTextDeleted();
}
- this.keyboardListener.onTextChanged();
+ listener.onTextChanged();
}
public void setKeyboardListener(KeyboardListener listener) {
diff --git a/src/main/java/eu/siacs/conversations/utils/LanguageUtils.java b/src/main/java/eu/siacs/conversations/utils/LanguageUtils.java
new file mode 100644
index 000000000..28cb44343
--- /dev/null
+++ b/src/main/java/eu/siacs/conversations/utils/LanguageUtils.java
@@ -0,0 +1,28 @@
+package eu.siacs.conversations.utils;
+
+import com.google.common.collect.ImmutableMap;
+
+import java.util.Locale;
+import java.util.Map;
+
+public class LanguageUtils {
+
+ private static final Map LANGUAGE_MAP;
+
+ static {
+ ImmutableMap.Builder builder = new ImmutableMap.Builder<>();
+ builder.put("german","de");
+ builder.put("deutsch","de");
+ builder.put("english","en");
+ builder.put("russian","ru");
+ LANGUAGE_MAP = builder.build();
+ }
+
+ public static String convert(final String in) {
+ if (in == null) {
+ return null;
+ }
+ final String out = LANGUAGE_MAP.get(in.toLowerCase(Locale.US));
+ return out == null ? in : out;
+ }
+}
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 9e70f3e5f..843079aea 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java
@@ -1003,16 +1003,17 @@ public class JingleConnection implements Transferable {
}
private void sendCandidateError() {
+ Log.d(Config.LOGTAG,"sending canditate error");
JinglePacket packet = bootstrapPacket("transport-info");
Content content = new Content(this.contentCreator, this.contentName);
content.setTransportId(this.transportId);
content.socks5transport().addChild("candidate-error");
packet.setContent(content);
this.sentCandidate = true;
+ this.sendJinglePacket(packet);
if (receivedCandidate && mJingleStatus == JINGLE_STATUS_ACCEPTED) {
connect();
}
- this.sendJinglePacket(packet);
}
public int getJingleStatus() {
diff --git a/src/main/res/layout/search_result_item.xml b/src/main/res/layout/search_result_item.xml
index 2d77be1fb..c006dabd8 100644
--- a/src/main/res/layout/search_result_item.xml
+++ b/src/main/res/layout/search_result_item.xml
@@ -1,6 +1,7 @@
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools">
+ app:riv_corner_radius="2dp" />
-
+ android:layout_marginLeft="@dimen/avatar_item_distance"
+ android:layout_toRightOf="@+id/avatar">
+ android:textAppearance="@style/TextAppearance.Conversations.Subhead"
+ tools:text="Proosdy IM Chat trantu" />
+
+
+ android:textAppearance="@style/TextAppearance.Conversations.Body1" />
+
-
+ android:textAppearance="@style/TextAppearance.Conversations.Body1.Secondary" />
+
\ No newline at end of file
diff --git a/src/main/res/values-eu/strings.xml b/src/main/res/values-eu/strings.xml
index d47019b86..01d0b0a36 100644
--- a/src/main/res/values-eu/strings.xml
+++ b/src/main/res/values-eu/strings.xml
@@ -422,8 +422,8 @@
Kokapena erakutsi dezakeen aplikaziorik ez da aurkitu
Kokapena
Elkarrizketa itxi egin da
- Talde pribatua utzi
- Kanal publikoa utzi
+ Talde pribatua utzi da
+ Kanal publikoa utzi da
Sistemaren CAtaz ez fidatu
Ziurtagiri guztiak eskuz onartu behar dira
Ziurtagiriak kendu
@@ -850,4 +850,14 @@
Parte-hartzaileak bilatu
Fitxategia handiegia da
Erantsi
+ Kanalak aurkitu
+ Kanalak bilatu
+ Balizko pribatutasun urraketa!
+ search.jabbercat.org izeneko hirugarren zerbitzu bat erabiltzen du.
Ezaugarri hau erabiltzeak zure IP helbidea eta bilatutako testua zerbitzu horretara bidaltzea dakar. Ikusi beren pribatutasun politika informazio gehiago lortzeko.]]>
+ Badaukat kontu bat dagoeneko
+ Gehitu existitzen den kontu bat
+ Kontu berria erregistratu
+ Honek domeinu helbide baten itxura dauka
+ Gehitu hala ere
+ Honek kanal helbide baten itxura dauka