Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 517a96f

Browse files
committed
TEMP: Remove the unread counts from stream drawer till the bugs are fixed
1 parent 6233694 commit 517a96f

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

app/src/main/java/com/zulip/android/activities/ExpandableStreamDrawerAdapter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,19 @@ public ExpandableStreamDrawerAdapter(final Context context, Cursor cursor, int g
3131

3232
@Override
3333
public Cursor getChildrenCursor(Cursor groupCursor) {
34-
int pointer = zulipApp.getPointer();
3534
List<String[]> results = new ArrayList<>();
3635
try {
37-
results = ZulipApp.get().getDao(Message.class).queryRaw("SELECT DISTINCT subject, count(case when messages.id > " + pointer + " or messages." + Message.MESSAGE_READ_FIELD + " = 0 then 1 end) as unreadcount FROM messages " +
36+
results = ZulipApp.get().getDao(Message.class).queryRaw("SELECT DISTINCT subject FROM messages " +
3837
"JOIN streams ON streams.id=messages.stream " +
3938
"WHERE streams.id=" + groupCursor.getInt(0) + " and streams." + Stream.SUBSCRIBED_FIELD + " = " + "1 group by subject").getResults();
4039
} catch (SQLException e) {
4140
ZLog.logException(e);
4241
}
43-
MatrixCursor matrixCursor = new MatrixCursor(new String[]{"subject", "_id", UNREAD_TABLE_NAME});
42+
MatrixCursor matrixCursor = new MatrixCursor(new String[]{"subject", "_id"});
4443

4544
for (String[] result : results) {
4645
try {
47-
matrixCursor.addRow(new String[]{result[0], String.valueOf(groupCursor.getInt(0)), result[1]});
46+
matrixCursor.addRow(new String[]{result[0], String.valueOf(groupCursor.getInt(0))});
4847
} catch (Exception e) {
4948
ZLog.logException(e);
5049
}

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,7 @@ private Callable<Cursor> getSteamCursorGenerator() {
668668
Callable<Cursor> steamCursorGenerator = new Callable<Cursor>() {
669669
@Override
670670
public Cursor call() throws Exception {
671-
int pointer = app.getPointer();
672-
String query = "SELECT s.id as _id, s.name, s.color, count(case when m.id > " + pointer + " or m." + Message.MESSAGE_READ_FIELD
673-
+ " = 0 then 1 end) as " + ExpandableStreamDrawerAdapter.UNREAD_TABLE_NAME
671+
String query = "SELECT s.id as _id, s.name, s.color"
674672
+ " FROM streams as s LEFT JOIN messages as m ON s.id=m.stream ";
675673
String selectArg = null;
676674
if (!etSearchStream.getText().toString().equals("") && !etSearchStream.getText().toString().isEmpty()) {
@@ -1192,11 +1190,11 @@ public void onAnimationRepeat(Animator animator) {
11921190
*/
11931191
private void setupListViewAdapter() {
11941192
streamsDrawerAdapter = null;
1195-
String[] groupFrom = {Stream.NAME_FIELD, Stream.COLOR_FIELD, ExpandableStreamDrawerAdapter.UNREAD_TABLE_NAME};
1196-
int[] groupTo = {R.id.name, R.id.stream_dot, R.id.unread_group};
1193+
String[] groupFrom = {Stream.NAME_FIELD, Stream.COLOR_FIELD};
1194+
int[] groupTo = {R.id.name, R.id.stream_dot};
11971195
// Comparison of data elements and View
1198-
String[] childFrom = {Message.SUBJECT_FIELD, ExpandableStreamDrawerAdapter.UNREAD_TABLE_NAME};
1199-
int[] childTo = {R.id.name_child, R.id.unread_child};
1196+
String[] childFrom = {Message.SUBJECT_FIELD};
1197+
int[] childTo = {R.id.name_child};
12001198
final ExpandableListView streamsDrawer = (ExpandableListView) findViewById(R.id.streams_drawer);
12011199
streamsDrawer.setGroupIndicator(null);
12021200
try {

0 commit comments

Comments
 (0)