|
|
|
@ -214,24 +214,13 @@ public class QuickLoad {
|
|
|
|
|
QuickLoad localQuickLoad = getSavedValue(account, Timeline.TimeLineEnum.LOCAL, null);
|
|
|
|
|
QuickLoad publicQuickLoad = getSavedValue(account, Timeline.TimeLineEnum.PUBLIC, null);
|
|
|
|
|
|
|
|
|
|
if (homeQuickLoad != null && homeQuickLoad.statuses != null) {
|
|
|
|
|
for (Status status : homeQuickLoad.statuses) {
|
|
|
|
|
if (status.id.equals(id)) {
|
|
|
|
|
homeQuickLoad.statuses.remove(status);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (Status status : localQuickLoad.statuses) {
|
|
|
|
|
if (status.id.equals(id)) {
|
|
|
|
|
localQuickLoad.statuses.remove(status);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (Status status : publicQuickLoad.statuses) {
|
|
|
|
|
if (status.id.equals(id)) {
|
|
|
|
|
publicQuickLoad.statuses.remove(status);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ContentValues valuesHome = new ContentValues();
|
|
|
|
|
valuesHome.put(Sqlite.COL_STATUSES, StatusDraft.mastodonStatusListToStringStorage(homeQuickLoad.statuses));
|
|
|
|
|
//Inserts token
|
|
|
|
@ -242,28 +231,46 @@ public class QuickLoad {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (localQuickLoad != null && localQuickLoad.statuses != null) {
|
|
|
|
|
for (Status status : localQuickLoad.statuses) {
|
|
|
|
|
if (status.id.equals(id)) {
|
|
|
|
|
localQuickLoad.statuses.remove(status);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ContentValues valuesLocal = new ContentValues();
|
|
|
|
|
valuesLocal.put(Sqlite.COL_STATUSES, StatusDraft.mastodonStatusListToStringStorage(homeQuickLoad.statuses));
|
|
|
|
|
valuesLocal.put(Sqlite.COL_STATUSES, StatusDraft.mastodonStatusListToStringStorage(localQuickLoad.statuses));
|
|
|
|
|
//Inserts token
|
|
|
|
|
try {
|
|
|
|
|
db.update(Sqlite.TABLE_QUICK_LOAD,
|
|
|
|
|
valuesLocal, Sqlite.COL_USER_ID + " = ? AND " + Sqlite.COL_INSTANCE + " =? AND " + Sqlite.COL_SLUG + "=?",
|
|
|
|
|
new String[]{homeQuickLoad.user_id, homeQuickLoad.instance, homeQuickLoad.slug});
|
|
|
|
|
new String[]{localQuickLoad.user_id, localQuickLoad.instance, localQuickLoad.slug});
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (publicQuickLoad != null && publicQuickLoad.statuses != null) {
|
|
|
|
|
for (Status status : publicQuickLoad.statuses) {
|
|
|
|
|
if (status.id.equals(id)) {
|
|
|
|
|
publicQuickLoad.statuses.remove(status);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ContentValues valuesPublic = new ContentValues();
|
|
|
|
|
valuesPublic.put(Sqlite.COL_STATUSES, StatusDraft.mastodonStatusListToStringStorage(homeQuickLoad.statuses));
|
|
|
|
|
valuesPublic.put(Sqlite.COL_STATUSES, StatusDraft.mastodonStatusListToStringStorage(publicQuickLoad.statuses));
|
|
|
|
|
//Inserts token
|
|
|
|
|
try {
|
|
|
|
|
db.update(Sqlite.TABLE_QUICK_LOAD,
|
|
|
|
|
valuesPublic, Sqlite.COL_USER_ID + " = ? AND " + Sqlite.COL_INSTANCE + " =? AND " + Sqlite.COL_SLUG + "=?",
|
|
|
|
|
new String[]{homeQuickLoad.user_id, homeQuickLoad.instance, homeQuickLoad.slug});
|
|
|
|
|
new String[]{publicQuickLoad.user_id, publicQuickLoad.instance, publicQuickLoad.slug});
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieves saved values
|
|
|
|
|
*
|
|
|
|
|