mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 16:50:04 +02:00
Fix #49 - Hidden timelines create an offset
This commit is contained in:
parent
cc23019bc1
commit
0bd7f987d0
1 changed files with 12 additions and 1 deletions
|
@ -24,6 +24,7 @@ import com.google.gson.annotations.SerializedName;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -155,7 +156,17 @@ public class Pinned implements Serializable {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Cursor c = db.query(Sqlite.TABLE_PINNED_TIMELINES, null, Sqlite.COL_INSTANCE + " = '" + account.instance + "' AND " + Sqlite.COL_USER_ID + " = '" + account.user_id + "'", null, null, null, Sqlite.COL_UPDATED_AT + " DESC", "1");
|
Cursor c = db.query(Sqlite.TABLE_PINNED_TIMELINES, null, Sqlite.COL_INSTANCE + " = '" + account.instance + "' AND " + Sqlite.COL_USER_ID + " = '" + account.user_id + "'", null, null, null, Sqlite.COL_UPDATED_AT + " DESC", "1");
|
||||||
return cursorToPined(c);
|
Pinned pinned = cursorToPined(c);
|
||||||
|
List<PinnedTimeline> pinnedTimelines = new ArrayList<>();
|
||||||
|
if (pinned != null) {
|
||||||
|
for (PinnedTimeline pinnedTimeline : pinned.pinnedTimelines) {
|
||||||
|
if (pinnedTimeline.displayed) {
|
||||||
|
pinnedTimelines.add(pinnedTimeline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pinned.pinnedTimelines = pinnedTimelines;
|
||||||
|
}
|
||||||
|
return pinned;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue