From 26114f83a6c849c2b769cb315623f9a322e6ed87 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 25 Aug 2015 06:38:14 -0700 Subject: [PATCH] fix chat view not being opened if move had arrived after chat by removing unneeded variable whose presence was clearing flags. --- .../src/org/eehouse/android/xw4/DBUtils.java | 8 +------ .../org/eehouse/android/xw4/GameUtils.java | 21 +++++-------------- .../eehouse/android/xw4/jni/GameSummary.java | 2 -- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java index 3921beb53..f582ccab3 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java @@ -142,7 +142,7 @@ public class DBUtils { DBHelper.ROOMNAME, DBHelper.RELAYID, /*DBHelper.SMSPHONE,*/ DBHelper.SEED, DBHelper.DICTLANG, DBHelper.GAMEID, - DBHelper.SCORES, DBHelper.HASMSGS, + DBHelper.SCORES, DBHelper.LASTPLAY_TIME, DBHelper.REMOTEDEVS, DBHelper.LASTMOVE, DBHelper.NPACKETSPENDING, DBHelper.EXTRAS, @@ -255,11 +255,6 @@ public class DBUtils { col = cursor.getColumnIndex( DBHelper.SERVERROLE ); tmp = cursor.getInt( col ); summary.serverRole = CurGameInfo.DeviceRole.values()[tmp]; - - col = cursor.getColumnIndex( DBHelper.HASMSGS ); - if ( col >= 0 ) { - summary.pendingMsgLevel = cursor.getInt( col ); - } } cursor.close(); db.close(); @@ -307,7 +302,6 @@ public class DBUtils { values.put( DBHelper.NEXTNAG, nextNag ); values.put( DBHelper.DICTLIST, summary.dictNames(DICTS_SEP) ); - values.put( DBHelper.HASMSGS, summary.pendingMsgLevel ); if ( null != inviteID ) { values.put( DBHelper.INVITEID, inviteID ); } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java index 716a16860..d635ca79c 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java @@ -162,13 +162,6 @@ public class GameUtils { } } - private static GameSummary summarizeAndClose( Context context, - GameLock lock, - int gamePtr, CurGameInfo gi ) - { - return summarizeAndClose( context, lock, gamePtr, gi, null ); - } - private static int setFromFeedImpl( FeedUtilsImpl feedImpl ) { int result = GameSummary.MSG_FLAGS_NONE; @@ -185,17 +178,12 @@ public class GameUtils { } private static GameSummary summarizeAndClose( Context context, - GameLock lock, - int gamePtr, CurGameInfo gi, - FeedUtilsImpl feedImpl ) + GameLock lock, int gamePtr, + CurGameInfo gi ) { GameSummary summary = new GameSummary( context, gi ); XwJNI.game_summarize( gamePtr, summary ); - if ( null != feedImpl ) { - summary.pendingMsgLevel |= setFromFeedImpl( feedImpl ); - } - DBUtils.saveSummary( context, lock, summary ); XwJNI.game_dispose( gamePtr ); @@ -923,12 +911,13 @@ public class GameUtils { } saveGame( context, gamePtr, gi, lock, false ); - summarizeAndClose( context, lock, gamePtr, gi, feedImpl ); + summarizeAndClose( context, lock, gamePtr, gi ); int flags = setFromFeedImpl( feedImpl ); if ( GameSummary.MSG_FLAGS_NONE != flags ) { draw = true; - DBUtils.setMsgFlags( rowid, flags ); + int curFlags = DBUtils.getMsgFlags( context, rowid ); + DBUtils.setMsgFlags( rowid, flags | curFlags ); } } lock.unlock(); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java index 11117d820..9d496ec6a 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/GameSummary.java @@ -63,7 +63,6 @@ public class GameSummary { public String roomName; public String relayID; public int seed; - public int pendingMsgLevel; public long modtime; public int gameID; public String[] remoteDevs; // BTAddrs and phone numbers @@ -83,7 +82,6 @@ public class GameSummary { public GameSummary( Context context ) { m_context = context; - pendingMsgLevel = 0; gameID = 0; }