From 5d1647f138763213a32e3e1ba426e3f86157f018 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 9 Jun 2012 08:53:39 -0700 Subject: Remove games from digest where the player already moved --- digest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'digest.php') diff --git a/digest.php b/digest.php index 0762519..d501e0a 100644 --- a/digest.php +++ b/digest.php @@ -105,6 +105,16 @@ foreach($users as $uid) // get messages $messages = DB_get_digest_message_by_email($email); + // check messages for outdated ones and delete those + foreach ($messages as $key=>$mess) + { + if($mess[2] == 'your_turn' && $uid != DB_get_player_by_gameid($mess[3]) ) + { + DB_digest_delete_message($mess[0]); + unset($messages[$key]); + } + } + // add them together if(sizeof($messages)) { -- cgit v1.2.3-18-g5258