summaryrefslogtreecommitdiffstats
path: root/digest.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2012-06-09 08:53:39 -0700
committerArun Persaud <arun@nubati.net>2012-06-09 09:48:09 -0700
commit5d1647f138763213a32e3e1ba426e3f86157f018 (patch)
tree0b7c1ffdf98bd0f42c4e09377e3747f3535478f9 /digest.php
parent21099cf40f1696e4e2213e3a497246a2e5570209 (diff)
downloade-DoKo-5d1647f138763213a32e3e1ba426e3f86157f018.tar.gz
e-DoKo-5d1647f138763213a32e3e1ba426e3f86157f018.tar.bz2
e-DoKo-5d1647f138763213a32e3e1ba426e3f86157f018.zip
Remove games from digest where the player already moved
Diffstat (limited to 'digest.php')
-rw-r--r--digest.php10
1 files changed, 10 insertions, 0 deletions
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))
{