mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-31 10:16:38 +00:00
Support for disappearing messages
// FREEBIE
This commit is contained in:
@@ -56,13 +56,14 @@ public class QuickResponseService extends MasterSecretIntentService {
|
||||
Recipients recipients = RecipientFactory.getRecipientsFromString(this, numbers, false);
|
||||
Optional<RecipientsPreferences> preferences = DatabaseFactory.getRecipientPreferenceDatabase(this).getRecipientsPreferences(recipients.getIds());
|
||||
int subscriptionId = preferences.isPresent() ? preferences.get().getDefaultSubscriptionId().or(-1) : -1;
|
||||
long expiresIn = preferences.isPresent() ? preferences.get().getExpireMessages() * 1000 : 0;
|
||||
|
||||
if (!TextUtils.isEmpty(content)) {
|
||||
if (recipients.isSingleRecipient()) {
|
||||
MessageSender.send(this, masterSecret, new OutgoingTextMessage(recipients, content, subscriptionId), -1, false);
|
||||
MessageSender.send(this, masterSecret, new OutgoingTextMessage(recipients, content, expiresIn, subscriptionId), -1, false);
|
||||
} else {
|
||||
MessageSender.send(this, masterSecret, new OutgoingMediaMessage(recipients, new SlideDeck(), content, System.currentTimeMillis(),
|
||||
subscriptionId, ThreadDatabase.DistributionTypes.DEFAULT), -1, false);
|
||||
subscriptionId, expiresIn, ThreadDatabase.DistributionTypes.DEFAULT), -1, false);
|
||||
}
|
||||
}
|
||||
} catch (URISyntaxException e) {
|
||||
|
||||
Reference in New Issue
Block a user