diff options
author | Thomas <tschneider.ac@gmail.com> | 2024-01-12 16:19:30 +0100 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2024-01-12 16:19:30 +0100 |
commit | 318b869b6a428980dd61c341a353c9aebcb1a27e (patch) | |
tree | 062abc2258d391903403a5e37094c8b3d0750663 /app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java | |
parent | 336fe936e8ccbb3a96183376df0f796b546b513a (diff) |
Fix hashtagscustom_intent
Diffstat (limited to 'app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java')
-rw-r--r-- | app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java b/app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java index 7e438623b..e9494fb2a 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java +++ b/app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java @@ -68,6 +68,26 @@ public class CachedBundle { } + public long insertAccountBundle(Account account, BaseAccount currentUser) throws DBException { + if (db == null) { + throw new DBException("db is null. Wrong initialization."); + } + ContentValues valuesAccount = new ContentValues(); + Bundle bundleAccount = new Bundle(); + if (account != null) { + bundleAccount.putSerializable(Helper.ARG_ACCOUNT, account); + valuesAccount.put(Sqlite.COL_BUNDLE, serializeBundle(bundleAccount)); + valuesAccount.put(Sqlite.COL_CREATED_AT, Helper.dateToString(new Date())); + valuesAccount.put(Sqlite.COL_TARGET_ID, account.id); + valuesAccount.put(Sqlite.COL_USER_ID, currentUser.user_id); + valuesAccount.put(Sqlite.COL_INSTANCE, currentUser.instance); + valuesAccount.put(Sqlite.COL_TYPE, CacheType.ACCOUNT.getValue()); + removeIntent(currentUser, account.id); + return db.insertOrThrow(Sqlite.TABLE_INTENT, null, valuesAccount); + } + return -1; + } + /** * Insert a bundle in db * |