mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-29 07:17:14 +00:00
Merge branch 'dev' of https://github.com/loki-project/session-android into specific-group-updates
This commit is contained in:
@@ -28,12 +28,14 @@ import com.annimon.stream.Collectors;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.mms.pdu_alt.NotificationInd;
|
||||
import com.google.android.mms.pdu_alt.PduHeaders;
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import net.sqlcipher.database.SQLiteDatabase;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.session.libsession.utilities.GroupUtil;
|
||||
import org.thoughtcrime.securesms.ApplicationContext;
|
||||
import org.thoughtcrime.securesms.attachments.MmsNotificationAttachment;
|
||||
import org.session.libsession.database.documents.IdentityKeyMismatch;
|
||||
@@ -686,7 +688,14 @@ public class MmsDatabase extends MessagingDatabase {
|
||||
throws MmsException
|
||||
{
|
||||
if (threadId == -1) {
|
||||
threadId = DatabaseFactory.getThreadDatabase(context).getOrCreateThreadIdFor(retrieved.getRecipient());
|
||||
if(retrieved.isGroup()) {
|
||||
ByteString decodedGroupId = ((OutgoingGroupMediaMessage)retrieved).getGroupContext().getId();
|
||||
String groupId = GroupUtil.doubleEncodeGroupID(decodedGroupId.toByteArray());
|
||||
Recipient group = Recipient.from(context, Address.fromSerialized(groupId), false);
|
||||
threadId = DatabaseFactory.getThreadDatabase(context).getOrCreateThreadIdFor(group);
|
||||
} else {
|
||||
threadId = DatabaseFactory.getThreadDatabase(context).getOrCreateThreadIdFor(retrieved.getRecipient());
|
||||
}
|
||||
}
|
||||
long messageId = insertMessageOutbox(retrieved, threadId, false, null, serverTimestamp);
|
||||
if (messageId == -1) {
|
||||
|
||||
@@ -424,7 +424,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
||||
.setName(name)
|
||||
.addAllMembers(members)
|
||||
.addAllAdmins(admins)
|
||||
val infoMessage = OutgoingGroupMediaMessage(recipient, groupContextBuilder.build(), null, sentTimestamp, 0, null, listOf(), listOf())
|
||||
val infoMessage = OutgoingGroupMediaMessage(recipient, groupContextBuilder.build(), null, sentTimestamp, 0, false, null, listOf(), listOf())
|
||||
val mmsDB = DatabaseFactory.getMmsDatabase(context)
|
||||
val mmsSmsDB = DatabaseFactory.getMmsSmsDatabase(context)
|
||||
if (mmsSmsDB.getMessageFor(sentTimestamp,userPublicKey) != null) return
|
||||
|
||||
Reference in New Issue
Block a user