mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-08 20:46:12 +01:00
use rowid for invitation notifications so they'll be replaced by
subsequent notifications for the same game and removed when the game's opened.
This commit is contained in:
parent
c9e8655eea
commit
ac34250bf3
4 changed files with 10 additions and 8 deletions
|
@ -1089,7 +1089,8 @@ public class BTService extends XWService {
|
|||
R.string.new_bt_body_fmt,
|
||||
sender );
|
||||
|
||||
GameUtils.postInvitedNotification( this, nli.gameID(), body );
|
||||
GameUtils.postInvitedNotification( this, nli.gameID(), body,
|
||||
rowid );
|
||||
|
||||
sendResult( MultiEvent.BT_GAME_CREATED, rowid );
|
||||
}
|
||||
|
|
|
@ -1066,11 +1066,11 @@ public class GameUtils {
|
|||
}
|
||||
|
||||
public static void postInvitedNotification( Context context, int gameID,
|
||||
String body )
|
||||
String body, long rowid )
|
||||
{
|
||||
Intent intent = GamesListDelegate.makeGameIDIntent( context, gameID );
|
||||
Utils.postNotification( context, intent, R.string.invite_notice_title,
|
||||
body, gameID );
|
||||
body, (int)rowid );
|
||||
}
|
||||
|
||||
private static void tellDied( Context context, GameLock lock,
|
||||
|
|
|
@ -260,7 +260,8 @@ public class RelayService extends XWService
|
|||
}
|
||||
String body = LocUtils.getString( this,
|
||||
R.string.new_relay_body );
|
||||
GameUtils.postInvitedNotification( this, nli.gameID(), body );
|
||||
GameUtils.postInvitedNotification( this, nli.gameID(), body,
|
||||
rowid );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -619,19 +619,19 @@ public class SMSService extends XWService {
|
|||
}
|
||||
}
|
||||
|
||||
private void postNotification( String phone, int gameID )
|
||||
private void postNotification( String phone, int gameID, long rowid )
|
||||
{
|
||||
String owner = Utils.phoneToContact( this, phone, true );
|
||||
String body = LocUtils.getString( this, R.string.new_name_body_fmt,
|
||||
owner );
|
||||
GameUtils.postInvitedNotification( this, gameID, body );
|
||||
GameUtils.postInvitedNotification( this, gameID, body, rowid );
|
||||
}
|
||||
|
||||
private void makeForInvite( String phone, NetLaunchInfo nli )
|
||||
{
|
||||
SMSMsgSink sink = new SMSMsgSink( this );
|
||||
long rowid = GameUtils.makeNewMultiGame( this, nli, sink, null );
|
||||
postNotification( phone, nli.gameID() );
|
||||
postNotification( phone, nli.gameID(), rowid );
|
||||
ackInvite( phone, nli.gameID() );
|
||||
}
|
||||
|
||||
|
@ -643,7 +643,7 @@ public class SMSService extends XWService {
|
|||
GameUtils.makeNewGame( this, gameID, new CommsAddrRec( phone ),
|
||||
lang, dict, nPlayersT, nPlayersH,
|
||||
forceChannel, gameName );
|
||||
postNotification( phone, gameID );
|
||||
postNotification( phone, gameID, rowid );
|
||||
ackInvite( phone, gameID );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue