fix not sending ACK_INVITE

Logic error meant it was never sent. Now always send on receipt of a
well-formed invitation, even if e.g. the recipient's missing a wordlist
and the game can't be started immediately.
This commit is contained in:
Eric House 2018-07-30 07:37:20 -07:00
parent a23777bade
commit bf06d4b4c2
2 changed files with 6 additions and 3 deletions

View file

@ -485,7 +485,7 @@ public class SMSService extends XWService {
} }
postEvent( MultiEvent.SMS_RECEIVE_OK ); postEvent( MultiEvent.SMS_RECEIVE_OK );
} else { } else {
Log.w( TAG, "receiveBuffer(): bogus or incomplete message from phone %s", Log.d( TAG, "receiveBuffer(): bogus or incomplete message from %s",
senderPhone ); senderPhone );
} }
} }
@ -501,8 +501,8 @@ public class SMSService extends XWService {
private void makeForInvite( String phone, NetLaunchInfo nli ) private void makeForInvite( String phone, NetLaunchInfo nli )
{ {
if ( nli != null && if ( nli != null ) {
handleInvitation( nli, phone, DictFetchOwner.OWNER_SMS ) ) { handleInvitation( nli, phone, DictFetchOwner.OWNER_SMS );
ackInvite( phone, nli.gameID() ); ackInvite( phone, nli.gameID() );
} }
} }

View file

@ -89,6 +89,7 @@ abstract class XWService extends Service {
abstract void postNotification( String device, int gameID, long rowid ); abstract void postNotification( String device, int gameID, long rowid );
// Return true if able to start game only
protected boolean handleInvitation( NetLaunchInfo nli, String device, protected boolean handleInvitation( NetLaunchInfo nli, String device,
DictFetchOwner dfo ) DictFetchOwner dfo )
{ {
@ -110,6 +111,7 @@ abstract class XWService extends Service {
} }
postNotification( device, nli.gameID(), rowid ); postNotification( device, nli.gameID(), rowid );
success = true;
} else { } else {
Intent intent = MultiService Intent intent = MultiService
.makeMissingDictIntent( this, nli, dfo ); .makeMissingDictIntent( this, nli, dfo );
@ -118,6 +120,7 @@ abstract class XWService extends Service {
} }
} }
} }
Log.d( TAG, "handleInvitation() => %b", success );
return success; return success;
} }