create a method for notification for new messages, and use it

This commit is contained in:
Evan Prodromou
2009-12-15 10:31:25 -05:00
parent 19bb9a04d1
commit 797a0d79fb
4 changed files with 11 additions and 9 deletions

View File

@@ -89,4 +89,12 @@ class Message extends Memcached_DataObject
$contentlimit = self::maxContent();
return ($contentlimit > 0 && !empty($content) && (mb_strlen($content) > $contentlimit));
}
function notify()
{
$from = User::staticGet('id', $this->from_profile);
$to = User::staticGet('id', $this->to_profile);
mail_notify_message($this, $from, $to);
}
}