mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-12 04:17:42 +00:00
expiration timer messages generation updated
This commit is contained in:
@@ -89,6 +89,7 @@ import org.session.libsession.messaging.messages.control.ExpirationTimerUpdate;
|
||||
import org.session.libsession.messaging.messages.visible.VisibleMessage;
|
||||
import org.session.libsession.messaging.sending_receiving.attachments.Attachment;
|
||||
import org.session.libsession.messaging.threads.DistributionTypes;
|
||||
import org.session.libsession.messaging.utilities.UpdateMessageBuilder;
|
||||
import org.session.libsession.utilities.GroupUtil;
|
||||
import org.session.libsession.utilities.MediaTypes;
|
||||
import org.session.libsignal.libsignal.InvalidMessageException;
|
||||
@@ -808,7 +809,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
DatabaseFactory.getRecipientDatabase(ConversationActivity.this).setExpireMessages(recipient, expirationTime);
|
||||
ExpirationTimerUpdate message = new ExpirationTimerUpdate(expirationTime);
|
||||
message.setSentTimestamp(System.currentTimeMillis());
|
||||
OutgoingExpirationUpdateMessage outgoingMessage = OutgoingExpirationUpdateMessage.from(message, recipient);
|
||||
String displayedMessage = UpdateMessageBuilder.INSTANCE.buildExpirationTimerMessage(getApplicationContext(), expirationTime, null, false);
|
||||
OutgoingExpirationUpdateMessage outgoingMessage = OutgoingExpirationUpdateMessage.from(message, recipient, displayedMessage);
|
||||
try {
|
||||
message.setId(DatabaseFactory.getMmsDatabase(ConversationActivity.this).insertMessageOutbox(outgoingMessage, getAllocatedThreadId(ConversationActivity.this), false, null));
|
||||
MessageSender.send(message, recipient.getAddress());
|
||||
|
@@ -175,7 +175,7 @@ public class ConversationUpdateItem extends LinearLayout
|
||||
icon.setImageResource(R.drawable.ic_group_grey600_24dp);
|
||||
icon.clearColorFilter();
|
||||
|
||||
GroupDescription.Companion.getDescription(getContext(), messageRecord.getBody()).addListener(this);
|
||||
GroupDescription.Companion.getDescription(getContext(), messageRecord.getBody()).addListener(this); //TODO Brice: could be removed if GroupDescription is removed
|
||||
body.setText(messageRecord.getDisplayBody(getContext()));
|
||||
|
||||
title.setVisibility(GONE);
|
||||
|
@@ -390,7 +390,7 @@ public class SmsDatabase extends MessagingDatabase {
|
||||
|
||||
values.put(REPLY_PATH_PRESENT, message.isReplyPathPresent());
|
||||
values.put(SERVICE_CENTER, message.getServiceCenterAddress());
|
||||
values.put(BODY, message.getMessageBody());
|
||||
values.put(BODY, message.getMessageBody()); //TODO Brice: is that encoded?
|
||||
values.put(TYPE, type);
|
||||
values.put(THREAD_ID, threadId);
|
||||
|
||||
|
@@ -13,6 +13,7 @@ import network.loki.messenger.R
|
||||
import org.session.libsignal.utilities.logging.Log
|
||||
import java.io.IOException
|
||||
|
||||
//TODO Brice: that class should be deprecated
|
||||
class GroupDescription(context: Context, groupContext: SignalServiceProtos.GroupContext?) {
|
||||
private val context: Context
|
||||
private val groupContext: SignalServiceProtos.GroupContext?
|
||||
|
@@ -6,6 +6,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.session.libsession.messaging.threads.Address;
|
||||
import org.session.libsession.messaging.threads.recipients.Recipient;
|
||||
import org.session.libsession.messaging.utilities.UpdateMessageBuilder;
|
||||
import org.session.libsession.utilities.SSKEnvironment;
|
||||
import org.session.libsignal.libsignal.util.guava.Optional;
|
||||
import org.session.libsignal.service.api.messages.SignalServiceGroup;
|
||||
@@ -78,10 +79,11 @@ public class ExpiringMessageManager implements SSKEnvironment.MessageExpirationM
|
||||
GroupContext groupContext = content.getDataMessage().getGroup();
|
||||
groupInfo = Optional.of(new SignalServiceGroup(groupContext.getId().toByteArray(), SignalServiceGroup.GroupType.SIGNAL));
|
||||
}
|
||||
String updateMessage = UpdateMessageBuilder.INSTANCE.buildExpirationTimerMessage(context, duration, senderPublicKey, false);
|
||||
IncomingMediaMessage mediaMessage = new IncomingMediaMessage(address, content.getDataMessage().getTimestamp(), -1,
|
||||
duration * 1000L, true,
|
||||
false,
|
||||
Optional.absent(),
|
||||
Optional.of(updateMessage),
|
||||
groupInfo,
|
||||
Optional.absent(),
|
||||
Optional.absent(),
|
||||
|
@@ -501,6 +501,7 @@
|
||||
<string name="MessageRecord_s_added_s_to_the_group">%1$s added %2$s to the group.</string>
|
||||
<string name="MessageRecord_you_removed_s_from_the_group">You removed %1$s from the group.</string>
|
||||
<string name="MessageRecord_s_removed_s_from_the_group">%1$s removed %2$s from the group.</string>
|
||||
<string name="MessageRecord_you_were_removed_from_the_group">You were removed from the group.</string>
|
||||
<string name="MessageRecord_you_called">You called</string>
|
||||
<string name="MessageRecord_called_you">Contact called</string>
|
||||
<string name="MessageRecord_missed_call">Missed call</string>
|
||||
|
Reference in New Issue
Block a user