fix chat view not being opened if move had arrived after chat by

removing unneeded variable whose presence was clearing flags.
This commit is contained in:
Eric House 2015-08-25 06:38:14 -07:00
parent 2aa9740814
commit 26114f83a6
3 changed files with 6 additions and 25 deletions

View file

@ -142,7 +142,7 @@ public class DBUtils {
DBHelper.ROOMNAME, DBHelper.RELAYID, DBHelper.ROOMNAME, DBHelper.RELAYID,
/*DBHelper.SMSPHONE,*/ DBHelper.SEED, /*DBHelper.SMSPHONE,*/ DBHelper.SEED,
DBHelper.DICTLANG, DBHelper.GAMEID, DBHelper.DICTLANG, DBHelper.GAMEID,
DBHelper.SCORES, DBHelper.HASMSGS, DBHelper.SCORES,
DBHelper.LASTPLAY_TIME, DBHelper.REMOTEDEVS, DBHelper.LASTPLAY_TIME, DBHelper.REMOTEDEVS,
DBHelper.LASTMOVE, DBHelper.NPACKETSPENDING, DBHelper.LASTMOVE, DBHelper.NPACKETSPENDING,
DBHelper.EXTRAS, DBHelper.EXTRAS,
@ -255,11 +255,6 @@ public class DBUtils {
col = cursor.getColumnIndex( DBHelper.SERVERROLE ); col = cursor.getColumnIndex( DBHelper.SERVERROLE );
tmp = cursor.getInt( col ); tmp = cursor.getInt( col );
summary.serverRole = CurGameInfo.DeviceRole.values()[tmp]; summary.serverRole = CurGameInfo.DeviceRole.values()[tmp];
col = cursor.getColumnIndex( DBHelper.HASMSGS );
if ( col >= 0 ) {
summary.pendingMsgLevel = cursor.getInt( col );
}
} }
cursor.close(); cursor.close();
db.close(); db.close();
@ -307,7 +302,6 @@ public class DBUtils {
values.put( DBHelper.NEXTNAG, nextNag ); values.put( DBHelper.NEXTNAG, nextNag );
values.put( DBHelper.DICTLIST, summary.dictNames(DICTS_SEP) ); values.put( DBHelper.DICTLIST, summary.dictNames(DICTS_SEP) );
values.put( DBHelper.HASMSGS, summary.pendingMsgLevel );
if ( null != inviteID ) { if ( null != inviteID ) {
values.put( DBHelper.INVITEID, inviteID ); values.put( DBHelper.INVITEID, inviteID );
} }

View file

@ -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 ) private static int setFromFeedImpl( FeedUtilsImpl feedImpl )
{ {
int result = GameSummary.MSG_FLAGS_NONE; int result = GameSummary.MSG_FLAGS_NONE;
@ -185,17 +178,12 @@ public class GameUtils {
} }
private static GameSummary summarizeAndClose( Context context, private static GameSummary summarizeAndClose( Context context,
GameLock lock, GameLock lock, int gamePtr,
int gamePtr, CurGameInfo gi, CurGameInfo gi )
FeedUtilsImpl feedImpl )
{ {
GameSummary summary = new GameSummary( context, gi ); GameSummary summary = new GameSummary( context, gi );
XwJNI.game_summarize( gamePtr, summary ); XwJNI.game_summarize( gamePtr, summary );
if ( null != feedImpl ) {
summary.pendingMsgLevel |= setFromFeedImpl( feedImpl );
}
DBUtils.saveSummary( context, lock, summary ); DBUtils.saveSummary( context, lock, summary );
XwJNI.game_dispose( gamePtr ); XwJNI.game_dispose( gamePtr );
@ -923,12 +911,13 @@ public class GameUtils {
} }
saveGame( context, gamePtr, gi, lock, false ); saveGame( context, gamePtr, gi, lock, false );
summarizeAndClose( context, lock, gamePtr, gi, feedImpl ); summarizeAndClose( context, lock, gamePtr, gi );
int flags = setFromFeedImpl( feedImpl ); int flags = setFromFeedImpl( feedImpl );
if ( GameSummary.MSG_FLAGS_NONE != flags ) { if ( GameSummary.MSG_FLAGS_NONE != flags ) {
draw = true; draw = true;
DBUtils.setMsgFlags( rowid, flags ); int curFlags = DBUtils.getMsgFlags( context, rowid );
DBUtils.setMsgFlags( rowid, flags | curFlags );
} }
} }
lock.unlock(); lock.unlock();

View file

@ -63,7 +63,6 @@ public class GameSummary {
public String roomName; public String roomName;
public String relayID; public String relayID;
public int seed; public int seed;
public int pendingMsgLevel;
public long modtime; public long modtime;
public int gameID; public int gameID;
public String[] remoteDevs; // BTAddrs and phone numbers public String[] remoteDevs; // BTAddrs and phone numbers
@ -83,7 +82,6 @@ public class GameSummary {
public GameSummary( Context context ) { public GameSummary( Context context ) {
m_context = context; m_context = context;
pendingMsgLevel = 0;
gameID = 0; gameID = 0;
} }