mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Periodically fetch release notes.
This commit is contained in:
@@ -56,6 +56,7 @@ import org.thoughtcrime.securesms.database.model.databaseprotos.BodyRangeList;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||
import org.thoughtcrime.securesms.jobs.TrimThreadJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreview;
|
||||
import org.thoughtcrime.securesms.mms.IncomingMediaMessage;
|
||||
import org.thoughtcrime.securesms.mms.MessageGroupContext;
|
||||
@@ -970,9 +971,10 @@ public class MmsDatabase extends MessageDatabase {
|
||||
}
|
||||
|
||||
private List<MarkedMessageInfo> setMessagesRead(String where, String[] arguments) {
|
||||
SQLiteDatabase database = databaseHelper.getSignalWritableDatabase();
|
||||
List<MarkedMessageInfo> result = new LinkedList<>();
|
||||
Cursor cursor = null;
|
||||
SQLiteDatabase database = databaseHelper.getSignalWritableDatabase();
|
||||
List<MarkedMessageInfo> result = new LinkedList<>();
|
||||
Cursor cursor = null;
|
||||
RecipientId releaseChannelId = SignalStore.releaseChannelValues().getReleaseChannelRecipientId();
|
||||
|
||||
database.beginTransaction();
|
||||
|
||||
@@ -990,7 +992,9 @@ public class MmsDatabase extends MessageDatabase {
|
||||
SyncMessageId syncMessageId = new SyncMessageId(recipientId, dateSent);
|
||||
ExpirationInfo expirationInfo = new ExpirationInfo(messageId, expiresIn, expireStarted, true);
|
||||
|
||||
result.add(new MarkedMessageInfo(threadId, syncMessageId, new MessageId(messageId, true), expirationInfo));
|
||||
if (!recipientId.equals(releaseChannelId)) {
|
||||
result.add(new MarkedMessageInfo(threadId, syncMessageId, new MessageId(messageId, true), expirationInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -664,6 +664,22 @@ open class RecipientDatabase(context: Context, databaseHelper: SignalDatabase) :
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only call once to create initial release channel recipient.
|
||||
*/
|
||||
fun insertReleaseChannelRecipient(): RecipientId {
|
||||
val values = ContentValues().apply {
|
||||
put(AVATAR_COLOR, AvatarColor.random().serialize())
|
||||
}
|
||||
|
||||
val id = writableDatabase.insert(TABLE_NAME, null, values)
|
||||
if (id < 0) {
|
||||
throw AssertionError("Failed to insert recipient!")
|
||||
} else {
|
||||
return GetOrInsertResult(RecipientId.from(id), true).recipientId
|
||||
}
|
||||
}
|
||||
|
||||
fun getBlocked(): Cursor {
|
||||
return readableDatabase.query(TABLE_NAME, ID_PROJECTION, "$BLOCKED = 1", null, null, null, null)
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.thoughtcrime.securesms.database.model.databaseprotos.ProfileChangeDet
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||
import org.thoughtcrime.securesms.jobs.TrimThreadJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.mms.IncomingMediaMessage;
|
||||
import org.thoughtcrime.securesms.mms.MmsException;
|
||||
import org.thoughtcrime.securesms.mms.OutgoingMediaMessage;
|
||||
@@ -591,9 +592,10 @@ public class SmsDatabase extends MessageDatabase {
|
||||
}
|
||||
|
||||
private List<MarkedMessageInfo> setMessagesRead(String where, String[] arguments) {
|
||||
SQLiteDatabase database = databaseHelper.getSignalWritableDatabase();
|
||||
List<MarkedMessageInfo> results = new LinkedList<>();
|
||||
Cursor cursor = null;
|
||||
SQLiteDatabase database = databaseHelper.getSignalWritableDatabase();
|
||||
List<MarkedMessageInfo> results = new LinkedList<>();
|
||||
Cursor cursor = null;
|
||||
RecipientId releaseChannelId = SignalStore.releaseChannelValues().getReleaseChannelRecipientId();
|
||||
|
||||
database.beginTransaction();
|
||||
try {
|
||||
@@ -610,7 +612,9 @@ public class SmsDatabase extends MessageDatabase {
|
||||
SyncMessageId syncMessageId = new SyncMessageId(recipientId, dateSent);
|
||||
ExpirationInfo expirationInfo = new ExpirationInfo(messageId, expiresIn, expireStarted, false);
|
||||
|
||||
results.add(new MarkedMessageInfo(threadId, syncMessageId, new MessageId(messageId, false), expirationInfo));
|
||||
if (!recipientId.equals(releaseChannelId)) {
|
||||
results.add(new MarkedMessageInfo(threadId, syncMessageId, new MessageId(messageId, false), expirationInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ import org.thoughtcrime.securesms.database.model.RecipientRecord;
|
||||
import org.thoughtcrime.securesms.database.model.ThreadRecord;
|
||||
import org.thoughtcrime.securesms.groups.BadGroupIdException;
|
||||
import org.thoughtcrime.securesms.groups.GroupId;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.mms.Slide;
|
||||
import org.thoughtcrime.securesms.mms.SlideDeck;
|
||||
import org.thoughtcrime.securesms.mms.StickerSlide;
|
||||
@@ -582,6 +583,10 @@ public class ThreadDatabase extends Database {
|
||||
|
||||
query += " AND " + ARCHIVED + " = 0";
|
||||
|
||||
if (SignalStore.releaseChannelValues().getReleaseChannelRecipientId() != null) {
|
||||
query += " AND " + RECIPIENT_ID + " != " + SignalStore.releaseChannelValues().getReleaseChannelRecipientId().toLong();
|
||||
}
|
||||
|
||||
return db.rawQuery(createQuery(query, 0, limit, true), null);
|
||||
}
|
||||
|
||||
@@ -1599,7 +1604,8 @@ public class ThreadDatabase extends Database {
|
||||
false,
|
||||
recipientSettings.getRegistered(),
|
||||
recipientSettings,
|
||||
null);
|
||||
null,
|
||||
false);
|
||||
recipient = new Recipient(recipientId, details, false);
|
||||
} else {
|
||||
recipient = Recipient.live(recipientId).get();
|
||||
|
||||
Reference in New Issue
Block a user