Notification bell (#2012)

* Add notification bell button, API endpoints and new relationship field

* Add notification type for subscriptions

* Add subscriptions to legacy notification filtering

* Update schemas

* Fix build

* Make rewrite static method into method of Notification class, fix getNotificationText

* Mastodon wording for subscriptions
This commit is contained in:
Alibek Omarov 2020-12-23 14:52:39 +03:00 committed by GitHub
commit b91a0aceeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 970 additions and 33 deletions

View file

@ -43,6 +43,7 @@ data class AccountEntity(@field:PrimaryKey(autoGenerate = true) var id: Long,
var notificationsReblogged: Boolean = true,
var notificationsFavorited: Boolean = true,
var notificationsPolls: Boolean = true,
var notificationsSubscriptions: Boolean = true,
var notificationSound: Boolean = true,
var notificationVibration: Boolean = true,
var notificationLight: Boolean = true,

View file

@ -30,7 +30,7 @@ import androidx.annotation.NonNull;
@Database(entities = {TootEntity.class, AccountEntity.class, InstanceEntity.class, TimelineStatusEntity.class,
TimelineAccountEntity.class, ConversationEntity.class
}, version = 23)
}, version = 24)
public abstract class AppDatabase extends RoomDatabase {
public abstract TootDao tootDao();
@ -339,5 +339,12 @@ public abstract class AppDatabase extends RoomDatabase {
database.execSQL("ALTER TABLE `TimelineStatusEntity` ADD COLUMN `muted` INTEGER");
}
};
public static final Migration MIGRATION_23_24 = new Migration(23, 24) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("ALTER TABLE `AccountEntity` ADD COLUMN `notificationsSubscriptions` INTEGER NOT NULL DEFAULT 1");
}
};
}