Skip to content

Commit

Permalink
Merge tag '2.17.2' into ninja-main
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
#	src/conversations/res/values-ru/strings.xml
  • Loading branch information
christianrowlands committed Oct 27, 2024
2 parents c583836 + 26d5290 commit 29b741b
Show file tree
Hide file tree
Showing 33 changed files with 567 additions and 153 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

### Version 2.17.2

* Fix calls on Android 15
* Fix rare crash / regression introduced with 2.17.0

### Version 2.17.1

* Fix UI glitch when showing multiple reactions

### Version 2.17.0

* Support Message Reactions
Expand Down
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,11 @@ run your own XMPP server for you and your friends. These XEP's are:
#### How do I install Conversations?

Conversations is entirely open source and licensed under GPLv3. So if you are a
software developer you can check out the sources from GitHub and use Gradle to
build your apk file.
software developer you can check out the sources from Codeberg and use Gradle to
build your APK file.

Conversations is available on [Google Play](https://play.google.com/store/apps/details?id=eu.siacs.conversations) and on [F-Droid](https://f-droid.org/en/packages/eu.siacs.conversations/).

#### I don't have a Google Account but I would still like to make a donation

I’m listing several options to support me financially on [my website](https://gultsch.de/donate.html). Among other things [Liberapay](https://liberapay.com/iNPUTmice/donate), [GitHub Sponsors](https://github.com/sponsors/inputmice) and bank transfer.

#### How do I create an account?
XMPP, like email, is a federated protocol, which means that there is not one company you can create an *official XMPP account* with. Instead there are hundreds, or even thousands, of providers out there. One of those providers is our very own [conversations.im](https://account.conversations.im). If you don’t like to use *conversations.im* use a web search engine of your choice to find another provider. Or maybe your university has one. Or you can run your own. Or ask a friend to run one. Once you've found one, you can use Conversations to create an account. Just select *register new account* on server within the create account dialog.

Expand Down Expand Up @@ -210,20 +206,10 @@ You can find a detailed description of how your server, the app server and FCM a
#### But why do I need a permanent notification if I use Google Push?
FCM (Google Push) allows an app to wake up from *Doze* which is (as the name suggests) a hibernation feature of the Android operating system that cuts the network connection and also reduces the number of times the app is allowed to wake up (to ping the server for example). The app can ask to be excluded from doze. Non push variants of the app (from F-Droid or if the server doesn’t support it) will do this on first start up. So if you get exemption from *Doze*, or if you get regular push events sent to you, Doze should not pose a threat to Conversatons working properly. But even with *Doze* the app is still open in the background (kept in memory); it is just limited in the actions it can do. Conversations needs to stay in memory to hold certain session state (online status of contacts, join status of group chats, …). However with Android 8 Google changed all of this again and now an App that wants to stay in memory needs to have a foreground service which is visible to the user via the annoying notification. But why does Conversations need to hold that state? XMPP is a statefull protocol that has a lot of per-session information; packets need to be counted, presence information needs to be held, some features like Message Carbons get activated once per session, MAM catch-up happens once, service discovery happens only once; the list goes on. When Conversations was created in early 2014 none of this was a problem because apps were just allowed to stay in memory. Basically every XMPP client out there holds that information in memory because it would be a lot more complicated trying to persist it to disk. An entire rewrite of Conversations in the year 2019 would attempt to do that and would probably succeed however it would require exactly that; a complete rewrite which is not feasible right now. That’s by the way also the reason why it is difficult to write an XMPP client on iOS. Or more broadly put this is also the reason why other protocols are designed as or migrated to stateless protocols (often based on HTTP); take for example the migration of IMAP to [JMAP](https://jmap.io/).

#### Conversations doesn’t work for me. Where can I get help?

You can join our conference room on [`[email protected]`](https://conversations.im/j/[email protected]).
A lot of people in there are able to answer basic questions about the usage of
Conversations or can provide you with tips on running your own XMPP server. If
you found a bug or your app crashes please read the Developer / Report Bugs
section of this document.

#### I need professional support with Conversations or setting up my server

I'm available for hire. Contact information can be found on [my website](https://gultsch.de).

#### How does the address book integration work?

Address book integration is only available in the F-Droid version.

The address book integration was designed to protect your privacy. Conversations
neither uploads contacts from your address book to your server nor fills your
address book with unnecessary contacts from your online roster. If you manually
Expand Down
8 changes: 8 additions & 0 deletions conversations.doap
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,14 @@
<xmpp:version>0.2.0</xmpp:version>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0421.html"/>
<xmpp:status>complete</xmpp:status>
<xmpp:version>0.2.0</xmpp:version>
<xmpp:since>2.17.0</xmpp:since>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0440.html"/>
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/de-DE/changelogs/4212104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Unterstützung von Reaktionen auf Nachrichten
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/4212204.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix UI glitch when showing multiple reactions
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/4212304.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Fix calls on Android 15
* Fix rare crash / regression introduced with 2.17.0
1 change: 1 addition & 0 deletions fastlane/metadata/android/gl-ES/changelogs/4212104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Compatibilidade con Reaccións ás Mensaxes
1 change: 1 addition & 0 deletions fastlane/metadata/android/pl-PL/changelogs/4212104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Obsługa reakcji na wiadomości
2 changes: 2 additions & 0 deletions fastlane/metadata/android/ru-RU/changelogs/4210904.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* исправлена регистрация Quicksy на Android 6-7
* проигрывание рингтона вызова через канал уведомлений
2 changes: 2 additions & 0 deletions fastlane/metadata/android/ru-RU/changelogs/4211004.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* исправлена интеграция звонков для устройств с Android 14
* добавлена настройка «Приглашения от незнакомцев»
2 changes: 2 additions & 0 deletions fastlane/metadata/android/ru-RU/changelogs/4211404.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* старые устройства Oppo исключены из интеграции звонков
* различные исправления
1 change: 1 addition & 0 deletions fastlane/metadata/android/ru-RU/changelogs/4211604.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Незначительные исправления
1 change: 1 addition & 0 deletions fastlane/metadata/android/ru-RU/changelogs/4211804.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Добавлено время истечения для попытки начала вызова
1 change: 1 addition & 0 deletions fastlane/metadata/android/ru-RU/changelogs/4212104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Поддержка реакций сообщений
1 change: 1 addition & 0 deletions fastlane/metadata/android/sq/changelogs/4212104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Mbulim për Reagime Ndaj Mesazhesh
1 change: 1 addition & 0 deletions fastlane/metadata/android/uk/changelogs/4212104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Підтримка реакцій на повідомлення
1 change: 1 addition & 0 deletions fastlane/metadata/android/zh-CN/changelogs/4212104.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* 支持消息回应
2 changes: 1 addition & 1 deletion src/conversations/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<string name="use_ninja.chat">Использовать ninja.chat</string>
<string name="create_new_account">Создать новый аккаунт</string>
<string name="do_you_have_an_account">У вас есть аккаунт XMPP? Если вы использовали Ninja Chat или другой XMPP-клиент в прошлом, то скорее всего, он у вас есть. Если у вас нет аккаунта, вы можете создать его прямо сейчас.
\nПодсказка: некоторые провайдеры электронной почты также регистрируют аккаунты XMPP.</string>
\nПодсказка: некоторые провайдеры эл. почты также предоставляют аккаунты XMPP.</string>
<string name="server_select_text">XMPP - это независимая сеть обмена сообщениями. Это приложение позволяет подключиться к любому XMPP-серверу на ваш выбор.
\nЕсли у вас нет сервера, предлагаем вам зарегистрировать аккаунт на ninja.chat, сервере, специально предназначенном для работы с Ninja Chat.</string>
<string name="magic_create_text_on_x">Вас пригласили на %1$s. Мы проведём вас через процесс создания аккаунта.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ public void accept(final im.conversations.android.xmpp.model.stanza.Message orig
final Conversation conversation =
mXmppConnectionService.find(account, counterpart.asBareJid());

if (conversation != null) {
if (conversation != null && reactingTo != null) {
if (isTypeGroupChat && conversation.getMode() == Conversational.MODE_MULTI) {
final var mucOptions = conversation.getMucOptions();
final var occupantId = occupant == null ? null : occupant.getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ private boolean selfManaged() {

public static boolean selfManaged(final Context context) {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
&& Build.VERSION.SDK_INT < 35
&& hasSystemFeature(context)
&& isDeviceModelSupported();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public void onStart() {

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
// TODO check for Camera / Scan permission
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (grantResults.length > 0)
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ protected void finishInitialSetup(final Avatar avatar) {

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO check for Camera / Scan permission
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_BATTERY_OP || requestCode == REQUEST_DATA_SAVER) {
updateAccountInformation(mAccount == null);
Expand Down Expand Up @@ -733,7 +734,7 @@ protected void onCreate(final Bundle savedInstanceState) {
this.binding.hostname.addTextChangedListener(mTextWatcher);
this.binding.hostname.setOnFocusChangeListener(mEditTextFocusListener);
this.binding.clearDevices.setOnClickListener(v -> showWipePepDialog());
this.binding.port.setText(String.valueOf(Resolver.DEFAULT_PORT_XMPP));
this.binding.port.setText(String.valueOf(Resolver.XMPP_PORT_STARTTLS));
this.binding.port.addTextChangedListener(mTextWatcher);
this.binding.saveButton.setOnClickListener(this.mSaveButtonClickListener);
this.binding.cancelButton.setOnClickListener(this.mCancelButtonClickListener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ public void onRequestPermissionsResult(
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (grantResults.length > 0)
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
ScanActivity.onRequestPermissionResult(this, requestCode, grantResults);
UriHandlerActivity.onRequestPermissionResult(this, requestCode, grantResults);
if (requestCode == REQUEST_SYNC_CONTACTS && xmppConnectionServiceBound) {
if (QuickConversationsService.isQuicksy()) {
setRefreshing(true);
Expand Down
58 changes: 38 additions & 20 deletions src/main/java/eu/siacs/conversations/utils/Resolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Strings;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
Expand Down Expand Up @@ -40,6 +41,7 @@
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
Expand Down Expand Up @@ -76,7 +78,8 @@ public class Resolver {

private static final ExecutorService DNS_QUERY_EXECUTOR = Executors.newFixedThreadPool(12);

public static final int DEFAULT_PORT_XMPP = 5222;
public static final int XMPP_PORT_STARTTLS = 5222;
private static final int XMPP_PORT_DIRECT_TLS = 5223;

private static final String DIRECT_TLS_SERVICE = "_xmpps-client";
private static final String STARTTLS_SERVICE = "_xmpp-client";
Expand Down Expand Up @@ -106,7 +109,7 @@ public static boolean invalidHostname(final String hostname) {
public static void clearCache() {}

public static boolean useDirectTls(final int port) {
return port == 443 || port == 5223;
return port == 443 || port == XMPP_PORT_DIRECT_TLS;
}

public static List<Result> resolve(final String domain) {
Expand Down Expand Up @@ -157,10 +160,7 @@ private static List<Result> fromIpAddress(final String domain) {
} catch (final UnknownHostException e) {
return Collections.emptyList();
}
final Result result = new Result();
result.ip = inetAddress;
result.port = DEFAULT_PORT_XMPP;
return Collections.singletonList(result);
return Result.createWithDefaultPorts(null, inetAddress);
} else {
return Collections.emptyList();
}
Expand Down Expand Up @@ -263,20 +263,22 @@ private static ListenableFuture<List<Result>> resolveNoSrvAsFuture(
Futures.transform(
resolveAsFuture(dnsName, A.class),
result ->
Lists.transform(
ImmutableList.copyOf(result.getAnswersOrEmptySet()),
a -> Result.createDefault(dnsName, a.getInetAddress())),
Result.createDefaults(
dnsName,
Collections2.transform(
result.getAnswersOrEmptySet(),
InternetAddressRR::getInetAddress)),
MoreExecutors.directExecutor());
futuresBuilder.add(aRecordResults);
ListenableFuture<List<Result>> aaaaRecordResults =
Futures.transform(
resolveAsFuture(dnsName, AAAA.class),
result ->
Lists.transform(
ImmutableList.copyOf(result.getAnswersOrEmptySet()),
aaaa ->
Result.createDefault(
dnsName, aaaa.getInetAddress())),
Result.createDefaults(
dnsName,
Collections2.transform(
result.getAnswersOrEmptySet(),
InternetAddressRR::getInetAddress)),
MoreExecutors.directExecutor());
futuresBuilder.add(aaaaRecordResults);
if (cName) {
Expand All @@ -299,7 +301,7 @@ private static ListenableFuture<List<Result>> resolveNoSrvAsFuture(
noSrvFallbacks,
results -> {
if (results.isEmpty()) {
return Collections.singletonList(Result.createDefault(dnsName));
return Result.createDefaults(dnsName);
} else {
return results;
}
Expand Down Expand Up @@ -330,7 +332,7 @@ public static class Result {
public static final String AUTHENTICATED = "authenticated";
private InetAddress ip;
private DnsName hostname;
private int port = DEFAULT_PORT_XMPP;
private int port = XMPP_PORT_STARTTLS;
private boolean directTls = false;
private boolean authenticated = false;
private int priority;
Expand All @@ -344,16 +346,32 @@ static Result fromRecord(final SRV srv, final boolean directTls) {
return result;
}

static Result createDefault(final DnsName hostname, final InetAddress ip) {
static List<Result> createWithDefaultPorts(final DnsName hostname, final InetAddress ip) {
return Lists.transform(
Arrays.asList(XMPP_PORT_STARTTLS, XMPP_PORT_DIRECT_TLS),
p -> createDefault(hostname, ip, p));
}

static Result createDefault(final DnsName hostname, final InetAddress ip, final int port) {
Result result = new Result();
result.port = DEFAULT_PORT_XMPP;
result.port = port;
result.hostname = hostname;
result.ip = ip;
result.directTls = useDirectTls(port);
return result;
}

static Result createDefault(final DnsName hostname) {
return createDefault(hostname, null);
static List<Result> createDefaults(
final DnsName hostname, final Collection<InetAddress> inetAddresses) {
final ImmutableList.Builder<Result> builder = new ImmutableList.Builder<>();
for (final InetAddress inetAddress : inetAddresses) {
builder.addAll(createWithDefaultPorts(hostname, inetAddress));
}
return builder.build();
}

static List<Result> createDefaults(final DnsName hostname) {
return createWithDefaultPorts(hostname, null);
}

public static Result fromCursor(final Cursor cursor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ public JingleRtpConnection initializeRtpSession(
final var contact = account.getRoster().getContact(with);
callIntegration.setCallerDisplayName(
contact.getDisplayName(), TelecomManager.PRESENTATION_ALLOWED);
callIntegration.setInitialized();
callIntegration.setInitialAudioDevice(CallIntegration.initialAudioDevice(media));
callIntegration.startAudioRouting();
final RtpSessionProposal proposal =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import com.google.common.base.Strings;
import com.google.common.collect.Collections2;

import im.conversations.android.annotation.XmlElement;
import im.conversations.android.xmpp.model.Extension;

import java.util.Collection;
import java.util.Objects;

Expand All @@ -21,7 +23,7 @@ public Collection<String> getReactions() {
}

public String getId() {
return this.getAttribute("id");
return Strings.emptyToNull(this.getAttribute("id"));
}

public void setId(String id) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/res/layout/item_message_received.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
android:orientation="horizontal"
android:visibility="visible"
app:chipSpacingHorizontal="4dp"
app:chipSpacingVertical="4dp"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/message_box"
app:layout_constraintTop_toBottomOf="@+id/reactions_anchor" />
Expand Down
5 changes: 4 additions & 1 deletion src/main/res/layout/item_message_sent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@
android:orientation="horizontal"
android:visibility="visible"
app:chipSpacingHorizontal="4dp"
app:chipSpacingVertical="4dp"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toEndOf="@+id/message_box"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/reactions_anchor" />

</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
Loading

0 comments on commit 29b741b

Please sign in to comment.