From d36f5e7e498b65d7bf8626d3d060d5fa6f0f4187 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 1 Feb 2020 10:00:54 -0800 Subject: [PATCH] make same-device invites work on gtk Added a confirm alert so accidental resends won't create useless games. --- xwords4/linux/gtkmain.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 9f322d254..740836aa5 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -716,10 +716,14 @@ relayInviteReceived( void* closure, NetLaunchInfo* invite ) sqlite3_int64 rowids[1]; int nRowIDs = VSIZE(rowids); getRowsForGameID( apg->cag.params->pDb, gameID, rowids, &nRowIDs ); - - if ( 0 < nRowIDs ) { - gtktell( apg->window, "Duplicate invite rejected (FIXME!!!)" ); - } else { + + bool doIt = 0 == nRowIDs; + if ( ! doIt ) { + doIt = GTK_RESPONSE_YES == gtkask( apg->window, + "Duplicate invitation received. Accept anyway?", + GTK_BUTTONS_YES_NO, NULL ); + } + if ( doIt ) { gameFromInvite( apg, invite, NULL ); } }