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.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 );
}

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 )
{
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();

View file

@ -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;
}