[Isocial-svn] SF.net SVN: isocial: [65] app/controllers/message_controller.php
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <agu...@us...> - 2008-03-11 20:02:20
|
Revision: 65 http://isocial.svn.sourceforge.net/isocial/?rev=65&view=rev Author: aguidrevitch Date: 2008-03-11 13:02:15 -0700 (Tue, 11 Mar 2008) Log Message: ----------- deletion problems fixed, try 3 Modified Paths: -------------- app/controllers/message_controller.php Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-11 19:54:15 UTC (rev 64) +++ app/controllers/message_controller.php 2008-03-11 20:02:15 UTC (rev 65) @@ -168,8 +168,10 @@ ); if ($threads) { foreach ($threads as $thread_loop_key => $thread) { - $is_del = $thread->sender_id == $this->current_user->getId() ? 'is_sender_del' : 'is_recipient_del'; - $this->Message->updateAll("$is_del = 1", "thread_id = " . $thread->thread_id); + list($user_col, $del_col) = $thread->sender_id == $this->current_user->getId() + ? array('sender_id', 'is_sender_del') + : array('recipient_id', 'is_recipient_del'); + $this->Message->updateAll("$del_col = 1", "$user_col = " . $this->current_user->getId() . " AND thread_id = " . $thread->thread_id); $this->Message->destroyAll("is_sender_del = 1 AND is_recipient_del = 1 AND thread_id = " . $thread->thread_id); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |