Skip to content

Commit

Permalink
Merge tag '2.16.4' into ninja-main
Browse files Browse the repository at this point in the history
# Conflicts:
#	settings.gradle
#	src/conversations/res/values-fr/strings.xml
#	src/conversations/res/values-pt-rBR/strings.xml
#	src/main/java/eu/siacs/conversations/parser/IqParser.java
#	src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
#	src/main/res/values-fr/strings.xml
  • Loading branch information
christianrowlands committed Jun 10, 2024
2 parents 3973685 + 6275d0c commit d50614c
Show file tree
Hide file tree
Showing 357 changed files with 7,531 additions and 2,444 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

### Version 2.16.4

* Fix minor regression introduced in 2.16.4

### Version 2.16.3

* exclude older Oppo devices from call integration
* various bug fixes

### Version 2.16.2

* Run Backup as foreground service to prevent process being stopped after 10 minutes

### Version 2.16.1

* Fix call getting un-muted when switching output devices
Expand Down
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,23 +278,15 @@ everybody in your contact list to know that you have been using your computer at
In the past status has been used to judge the likelihood of whether or not your
messages are being read. This is no longer necessary. With Chat Markers
(XEP-0333, supported by Conversations since 0.4) we have the ability to **know**
whether or not your messages are being read. Similar things can be said for
priorities. In the past priorities have been used (by servers, not by clients!)
to route your messages to one specific client. With carbon messages (XEP-0280,
supported by Conversations since 0.1) this is no longer necessary. Using
priorities to route OTR messages isn't practical either because they are not
changeable on the fly. Metrics like last active client (the client which sent
the last message) are much better.

Unfortunately these modern replacements for legacy XMPP features are not widely
adopted. However Conversations should be an instant messenger for the future and
instead of making Conversations compatible with the past we should work on
implementing new, improved technologies and getting them into other XMPP clients
as well.

Making these status and priority optional isn't a solution either because
Conversations is trying to get rid of old behaviours and set an example for
other clients.
whether or not your messages are being read.
* one check mark ✓: message has been send (arrived at server)
* two check marks ✓✓: message has arrived at receiver
* text _"has read up to this point"_: receiver has read the message (receiver might has read notifications turned off)

Similar things can be said for priorities. In the past priorities have been used
(by servers, not by clients!) to route your messages to one specific client.
With carbon messages (XEP-0280, supported by Conversations since 0.1) this is no
longer necessary.

#### Translations
Translations are managed on [Weblate](https://translate.codeberg.org/projects/conversations/).
Expand Down
18 changes: 11 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ configurations {
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'

implementation project(':libs:annotation')
annotationProcessor project(':libs:annotation-processor')


implementation 'androidx.viewpager:viewpager:1.0.0'

playstoreImplementation('com.google.firebase:firebase-messaging:24.0.0') {
Expand All @@ -46,10 +50,10 @@ dependencies {
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
}
conversationsPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2")
quicksyPlaystoreImplementation 'com.google.android.gms:play-services-auth-api-phone:18.0.2'
quicksyPlaystoreImplementation 'com.google.android.gms:play-services-auth-api-phone:18.1.0'
implementation 'com.github.open-keychain.open-keychain:openpgp-api:v5.7.1'
implementation("com.github.CanHub:Android-Image-Cropper:2.0.0")
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.exifinterface:exifinterface:1.3.7'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.preference:preference:1.2.1"
Expand Down Expand Up @@ -84,12 +88,12 @@ dependencies {
implementation 'me.drakeet.support:toastcompat:1.1.0'
implementation "com.leinardi.android:speed-dial:3.3.0"

implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation "com.squareup.retrofit2:retrofit:2.11.0"
implementation "com.squareup.retrofit2:converter-gson:2.11.0"
implementation "com.squareup.okhttp3:okhttp:4.12.0"

implementation 'com.google.guava:guava:32.1.3-android'
quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.13.28'
quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.13.35'
implementation 'im.conversations.webrtc:webrtc-android:119.0.1'

// Import the Firebase BoM
Expand All @@ -110,8 +114,8 @@ android {
defaultConfig {
minSdkVersion 23
targetSdkVersion 34
versionCode 42112
versionName "2.16.1"
versionCode 42115
versionName "2.16.4"
archivesBaseName += "-$versionName"
applicationId "com.ninja.chat"
resValue "string", "applicationId", applicationId
Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/android/de-DE/changelogs/4211104.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* Wiederkehrende Sicherungen planen
* Realme Geräte von der Anrufintegration ausgenommen
* Realme-Geräte von der Anrufintegration ausgenommen
* Kleine Designverbesserungen (Chatblasen)
2 changes: 2 additions & 0 deletions fastlane/metadata/android/de-DE/changelogs/4211204.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Anruf wird nicht mehr stummgeschaltet, wenn das Ausgabegerät gewechselt wird
* Umidigi-Geräte von der Anrufintegration ausgenommen
1 change: 1 addition & 0 deletions fastlane/metadata/android/de-DE/changelogs/4211304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sicherung als Vordergrunddienst ausführen, damit der Prozess nicht nach 10 Minuten gestoppt wird
2 changes: 2 additions & 0 deletions fastlane/metadata/android/de-DE/changelogs/4211404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Ältere Oppo-Geräte von der Anrufintegration ausgenommen
* Verschiedene Fehlerbehebungen
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/4211304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Run Backup as foreground service to prevent process being stopped after 10 minutes
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/4211404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* exclude older Oppo devices from call integration
* various bug fixes
4 changes: 4 additions & 0 deletions fastlane/metadata/android/fr-FR/changelogs/349.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* Introduction d'un paramètre expert pour faire la découverte de salons sur le serveur local au lieu de search.jabber.network
* Active les coches de délivrance par défaut et supprimer le paramètre
* Active ‘Le bouton Envoyer indique l'état’ par défaut et supprimer le paramètre
* Déplacer les paramètres du service de sauvegarde et de premier plan vers l'écran principal
2 changes: 2 additions & 0 deletions fastlane/metadata/android/gl-ES/changelogs/4211204.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Arranxo da chamada que deixa de estar silenciada ao cambiar o dispositivo de saída
* Exclusión da integración de chamadas para todos os dispositivos Umidigi
1 change: 1 addition & 0 deletions fastlane/metadata/android/gl-ES/changelogs/4211304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Crear a Copia de Apoio usando o servizo en primeiro plano para evitar que sexa detido após 10 minutos
2 changes: 2 additions & 0 deletions fastlane/metadata/android/gl-ES/changelogs/4211404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* excluír da integración de chamadas aos dispositivos Oppo antigos
* arranxos varios
2 changes: 2 additions & 0 deletions fastlane/metadata/android/it-IT/changelogs/4211204.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Corrette le chiamate che venivano smutate cambiando dispositivi di output
* Esclusi tutti i dispositivi Umidigi dall'integrazione di chiamate
1 change: 1 addition & 0 deletions fastlane/metadata/android/it-IT/changelogs/4211304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Avvia backup come servizio in primo piano per impedire che il servizio si fermi dopo 10 minuti
2 changes: 2 additions & 0 deletions fastlane/metadata/android/pl-PL/changelogs/4211204.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Naprawienie wyłączania wyciszenia rozmowy przy przełączaniu urządzeń wyjściowych
* Wyłączenie wszystkich urządzeń Umidigi z integracji rozmów
1 change: 1 addition & 0 deletions fastlane/metadata/android/pl-PL/changelogs/4211304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Uruchamianie kopii zapasowej jako usługi na pierwszym planie, żeby proces nie był zatrzymywany po 10 minutach
2 changes: 2 additions & 0 deletions fastlane/metadata/android/pl-PL/changelogs/4211404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Wyłączenie starszych urządzeń Umidigi z integracji rozmów
* Różne poprawki błędów
3 changes: 3 additions & 0 deletions fastlane/metadata/android/sq/changelogs/4211104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Planifikim kopjeruajtjesh periodike
* Përjashtim i krejt pajisjeve “realme”, deri te Android 11, nga integrim thirrjesh
* Përmirësime të vockla UI (flluskë mesazhi)
2 changes: 2 additions & 0 deletions fastlane/metadata/android/sq/changelogs/4211204.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Ndreqje çheshtimi thirrjeje, kur ndërrohet pajisje dëgjimi
* Përjashtim i krejt pajisjeve Umidigi nga integrim thirrjesh
1 change: 1 addition & 0 deletions fastlane/metadata/android/sq/changelogs/4211304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Xhirim Kopjeruajtje si shërbim në prapaskenë, për të parandaluar ndalimin e procesit pas 10 minutash
2 changes: 2 additions & 0 deletions fastlane/metadata/android/uk/changelogs/4211204.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Виправлено ввімкнення звуку виклику при перемиканні пристроїв виводу
* Виключення всіх пристроїв Umidigi з інтеграції викликів
1 change: 1 addition & 0 deletions fastlane/metadata/android/uk/changelogs/4211304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Резервне копіювання запускається як процес на передньому плані, щоб запобігти його зупинці через 10 хвилин
2 changes: 2 additions & 0 deletions fastlane/metadata/android/uk/changelogs/4211404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Виключення старих пристроїв Oppo з інтеграції викликів
* Виправлення різноманітних помилок
6 changes: 3 additions & 3 deletions fastlane/metadata/android/zh-CN/changelogs/42037.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
版本2.10.9
版本 2.10.9
* 进行音视频通话时请求蓝牙权限(如果您不使用蓝牙耳机可以拒绝)
* 修复呼叫 Movim 时的错误
* 修复群组聊天的显示错误头像的问题
* 修复群聊显示错误头像的问题
* 始终要求选择退出电池优化
* 在“x 个已连接账号”通知上设置仅本地标志
* 修复与 Google 地图分享位置插件的交互
* 移除有关服务器费用的脚注
* 将文件存储在适合 Android 11 的位置
* 网络切换后尝试重新连接通话
* 在来电屏幕中显示来电者JID和帐户JID
* 在来电屏幕中显示来电者 JID 和账号JID
2 changes: 1 addition & 1 deletion fastlane/metadata/android/zh-CN/changelogs/4211104.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* 计划定期备份
* 将所有 Android 11 以下的 realme 设备排除在呼叫集成之外
* 从呼叫集成中排除所有 Android 11 以下的 realme 设备
* 用户界面(消息气泡)小幅改进
2 changes: 2 additions & 0 deletions fastlane/metadata/android/zh-CN/changelogs/4211204.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* 修复切换输出设备时呼叫未静音的问题
* 从呼叫集成中排除所有 Umidigi 设备
1 change: 1 addition & 0 deletions fastlane/metadata/android/zh-CN/changelogs/4211304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* 作为前台服务运行备份,防止进程在 10 分钟后停止
2 changes: 2 additions & 0 deletions fastlane/metadata/android/zh-CN/changelogs/4211404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* 从呼叫集成中排除较旧的 OPPO 设备
* 各种错误修复
20 changes: 20 additions & 0 deletions libs/annotation-processor/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apply plugin: "java-library"

repositories {
google()
mavenCentral()
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
dependencies {

implementation project(':libs:annotation')

annotationProcessor 'com.google.auto.service:auto-service:1.0.1'
api 'com.google.auto.service:auto-service-annotations:1.0.1'
implementation 'com.google.guava:guava:31.1-jre'

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
package im.conversations.android.annotation.processor;

import com.google.auto.service.AutoService;
import com.google.common.base.CaseFormat;
import com.google.common.base.Objects;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;

import im.conversations.android.annotation.XmlElement;
import im.conversations.android.annotation.XmlPackage;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Processor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.ElementFilter;
import javax.tools.JavaFileObject;

@AutoService(Processor.class)
@SupportedSourceVersion(SourceVersion.RELEASE_17)
@SupportedAnnotationTypes("im.conversations.android.annotation.XmlElement")
public class XmlElementProcessor extends AbstractProcessor {

@Override
public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnvironment) {
final Set<? extends Element> elements =
roundEnvironment.getElementsAnnotatedWith(XmlElement.class);
final ImmutableMap.Builder<Id, String> builder = ImmutableMap.builder();
for (final Element element : elements) {
if (element instanceof final TypeElement typeElement) {
final Id id = of(typeElement);
builder.put(id, typeElement.getQualifiedName().toString());
}
}
final ImmutableMap<Id, String> maps = builder.build();
if (maps.isEmpty()) {
return false;
}
final JavaFileObject extensionFile;
try {
extensionFile =
processingEnv
.getFiler()
.createSourceFile("im.conversations.android.xmpp.Extensions");
} catch (final IOException e) {
throw new RuntimeException(e);
}
try (final PrintWriter out = new PrintWriter(extensionFile.openWriter())) {
out.println("package im.conversations.android.xmpp;");
out.println("import com.google.common.collect.BiMap;");
out.println("import com.google.common.collect.ImmutableBiMap;");
out.println("import im.conversations.android.xmpp.ExtensionFactory;");
out.println("import im.conversations.android.xmpp.model.Extension;");
out.print("\n");
out.println("public final class Extensions {");
out.println(
"public static final BiMap<ExtensionFactory.Id, Class<? extends Extension>>"
+ " EXTENSION_CLASS_MAP;");
out.println("static {");
out.println(
"final var builder = new ImmutableBiMap.Builder<ExtensionFactory.Id, Class<?"
+ " extends Extension>>();");
for (final Map.Entry<Id, String> entry : maps.entrySet()) {
Id id = entry.getKey();
String clazz = entry.getValue();
out.format(
"builder.put(new ExtensionFactory.Id(\"%s\",\"%s\"),%s.class);",
id.name, id.namespace, clazz);
out.print("\n");
}
out.println("EXTENSION_CLASS_MAP = builder.build();");
out.println("}");
out.println(" private Extensions() {}");
out.println("}");
// writing generated file to out …
} catch (IOException e) {
throw new RuntimeException(e);
}
return true;
}

private static Id of(final TypeElement typeElement) {
final XmlElement xmlElement = typeElement.getAnnotation(XmlElement.class);
final PackageElement packageElement = getPackageElement(typeElement);
final XmlPackage xmlPackage =
packageElement == null ? null : packageElement.getAnnotation(XmlPackage.class);
if (xmlElement == null) {
throw new IllegalStateException(
String.format(
"%s is not annotated as @XmlElement",
typeElement.getQualifiedName().toString()));
}
final String packageNamespace = xmlPackage == null ? null : xmlPackage.namespace();
final String elementName = xmlElement.name();
final String elementNamespace = xmlElement.namespace();
final String namespace;
if (!Strings.isNullOrEmpty(elementNamespace)) {
namespace = elementNamespace;
} else if (!Strings.isNullOrEmpty(packageNamespace)) {
namespace = packageNamespace;
} else {
throw new IllegalStateException(
String.format(
"%s does not declare a namespace",
typeElement.getQualifiedName().toString()));
}
if (!hasEmptyDefaultConstructor(typeElement)) {
throw new IllegalStateException(
String.format(
"%s does not have an empty default constructor",
typeElement.getQualifiedName().toString()));
}
final String name;
if (Strings.isNullOrEmpty(elementName)) {
name =
CaseFormat.UPPER_CAMEL.to(
CaseFormat.LOWER_HYPHEN, typeElement.getSimpleName().toString());
} else {
name = elementName;
}
return new Id(name, namespace);
}

private static PackageElement getPackageElement(final TypeElement typeElement) {
final Element parent = typeElement.getEnclosingElement();
if (parent instanceof PackageElement) {
return (PackageElement) parent;
} else {
final Element nextParent = parent.getEnclosingElement();
if (nextParent instanceof PackageElement) {
return (PackageElement) nextParent;
} else {
return null;
}
}
}

private static boolean hasEmptyDefaultConstructor(final TypeElement typeElement) {
final List<ExecutableElement> constructors =
ElementFilter.constructorsIn(typeElement.getEnclosedElements());
for (final ExecutableElement constructor : constructors) {
if (constructor.getParameters().isEmpty()
&& constructor.getModifiers().contains(Modifier.PUBLIC)) {
return true;
}
}
return false;
}

public static class Id {
public final String name;
public final String namespace;

public Id(String name, String namespace) {
this.name = name;
this.namespace = namespace;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Id id = (Id) o;
return Objects.equal(name, id.name) && Objects.equal(namespace, id.namespace);
}

@Override
public int hashCode() {
return Objects.hashCode(name, namespace);
}
}
}
Loading

0 comments on commit d50614c

Please sign in to comment.