This commit is contained in:
Mikunj 2019-12-09 11:50:22 +11:00
parent b44ff69d8d
commit 151e97c82e
5 changed files with 4 additions and 37 deletions

View File

@ -1653,7 +1653,6 @@
<string name="dialog_device_unlink_title">Device unlinked</string>
<string name="dialog_device_unlink_message">This device has been successfully unlinked</string>
<!-- Session restore banner -->
<string name="session_restore_banner_title">Could not decrypt an incoming message.</string>
<string name="session_restore_banner_message">Would you like to start a new session with %s?</string>
<string name="session_restore_banner_restore_button_title">Restore session</string>
<string name="session_restore_banner_dismiss_button_title">Dismiss</string>

View File

@ -83,7 +83,7 @@ public interface MmsSmsColumns {
protected static final long ENCRYPTION_REMOTE_LEGACY_BIT = 0x02000000;
// Loki
protected static final long ENCRYPTION_LOKI_SESSION_RESTORE_SENT_BIT = 0x01000000; // Type that determines if we've sent a session reset after receiving `ENCRYPTION_REMOTE_NO_SESSION_BIT`
protected static final long ENCRYPTION_LOKI_SESSION_RESTORE_SENT_BIT = 0x01000000;
public static boolean isDraftMessageType(long type) {
return (type & BASE_TYPE_MASK) == BASE_DRAFT_TYPE;

View File

@ -732,21 +732,6 @@ public class SmsDatabase extends MessagingDatabase {
else return record;
}
public List<SmsMessageRecord> getMessages(long threadId) {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
Cursor cursor = db.query(TABLE_NAME, MESSAGE_PROJECTION, THREAD_ID + " = ?", new String[]{ threadId + "" }, null, null, null);
Reader reader = new Reader(cursor);
List<SmsMessageRecord> records = new ArrayList<>();
SmsMessageRecord record = reader.getNext();
while (record != null) {
records.add(record);
record = reader.getNext();
}
reader.close();
return records;
}
public Cursor getMessageCursor(long messageId) {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
Cursor cursor = db.query(TABLE_NAME, MESSAGE_PROJECTION, ID_WHERE, new String[] {messageId + ""}, null, null, null);

View File

@ -1,18 +0,0 @@
package org.thoughtcrime.securesms.loki
import org.thoughtcrime.securesms.util.Debouncer
object DebouncerCache {
private val cache: HashMap<String, Debouncer> = hashMapOf()
@JvmStatic
fun getDebouncer(key: String, threshold: Long): Debouncer {
val throttler = cache[key] ?: Debouncer(threshold)
cache[key] = throttler
return throttler
}
@JvmStatic
fun remove(key: String) {
cache.remove(key)
}
}

View File

@ -26,10 +26,11 @@ object FriendRequestHandler {
ActionType.Failed -> LokiThreadFriendRequestStatus.NONE
ActionType.Sent -> LokiThreadFriendRequestStatus.REQUEST_SENT
}
DatabaseFactory.getLokiThreadDatabase(context).setFriendRequestStatus(threadId, threadFriendStatus)
val database = DatabaseFactory.getLokiThreadDatabase(context)
database.setFriendRequestStatus(threadId, threadFriendStatus)
// If we sent a friend request then we need to hide the session restore prompt
if (type == ActionType.Sent) {
// TODO: Hide prompt
database.removeAllSessionRestoreDevices(threadId)
}
}