resend invitation if send has failed

This commit is contained in:
Brice-W 2021-05-13 14:57:14 +10:00
parent 2f0509a03b
commit e1b8f10eec
2 changed files with 14 additions and 3 deletions

View File

@ -38,11 +38,12 @@ import androidx.loader.content.Loader;
import org.session.libsession.messaging.messages.visible.LinkPreview;
import org.session.libsession.messaging.messages.visible.OpenGroupInvitation;
import org.session.libsession.messaging.messages.visible.Quote;
import org.session.libsession.messaging.messages.visible.VisibleMessage;
import org.session.libsession.messaging.open_groups.OpenGroup;
import org.session.libsession.messaging.sending_receiving.MessageSender;
import org.session.libsession.messaging.sending_receiving.attachments.Attachment;
import org.session.libsession.messaging.utilities.UpdateMessageData;
import org.thoughtcrime.securesms.MessageDetailsRecipientAdapter.RecipientDeliveryStatus;
import org.session.libsession.utilities.color.MaterialColor;
import org.thoughtcrime.securesms.conversation.ConversationItem;
@ -448,7 +449,18 @@ public class MessageDetailsActivity extends PassphraseRequiredActionBarActivity
Recipient recipient = messageRecord.getRecipient();
VisibleMessage message = new VisibleMessage();
message.setId(messageRecord.getId());
message.setText(messageRecord.getBody());
if (messageRecord.isOpenGroupInvitation()) {
OpenGroupInvitation openGroupInvitation = new OpenGroupInvitation();
UpdateMessageData updateMessageData = UpdateMessageData.Companion.fromJSON(messageRecord.getBody());
if (updateMessageData.getKind() instanceof UpdateMessageData.Kind.OpenGroupInvitation) {
UpdateMessageData.Kind.OpenGroupInvitation data = (UpdateMessageData.Kind.OpenGroupInvitation)updateMessageData.getKind();
openGroupInvitation.setGroupName(data.getGroupName());
openGroupInvitation.setGroupUrl(data.getGroupUrl());
}
message.setOpenGroupInvitation(openGroupInvitation);
} else {
message.setText(messageRecord.getBody());
}
message.setSentTimestamp(messageRecord.getTimestamp());
if (recipient.isGroupRecipient()) {
message.setGroupPublicKey(recipient.getAddress().toGroupString());

View File

@ -65,7 +65,6 @@ import org.session.libsession.messaging.threads.recipients.Recipient;
import org.session.libsession.messaging.threads.recipients.RecipientModifiedListener;
import org.session.libsession.messaging.utilities.UpdateMessageData;
import org.session.libsession.utilities.GroupUtil;
import org.session.libsession.utilities.OpenGroupUrlParser;
import org.session.libsession.utilities.TextSecurePreferences;
import org.session.libsession.utilities.ThemeUtil;
import org.session.libsession.utilities.Util;