don't write notice to inbox if user isn't inboxed yet
darcs-hash:20081114074211-84dde-77dbee17b2eb5848a0aa012c6ebe352135f5e7c1.gz
This commit is contained in:
parent
11fba88213
commit
6b6c966369
|
@ -374,14 +374,19 @@ class Notice extends Memcached_DataObject
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToInboxes() {
|
function addToInboxes() {
|
||||||
|
$enabled = common_config('inboxes', 'enabled');
|
||||||
|
|
||||||
|
if ($enabled === true || $enabled === 'transitional') {
|
||||||
$inbox = new Notice_inbox();
|
$inbox = new Notice_inbox();
|
||||||
|
$qry = 'INSERT INTO notice_inbox (user_id, notice_id, created) ' .
|
||||||
$inbox->query('INSERT INTO notice_inbox (user_id, notice_id, created) ' .
|
|
||||||
'SELECT user.id, ' . $this->id . ', "' . $this->created . '" ' .
|
'SELECT user.id, ' . $this->id . ', "' . $this->created . '" ' .
|
||||||
'FROM user JOIN subscription ON user.id = subscription.subscriber ' .
|
'FROM user JOIN subscription ON user.id = subscription.subscriber ' .
|
||||||
'WHERE subscription.subscribed = ' . $this->profile_id);
|
'WHERE subscription.subscribed = ' . $this->profile_id;
|
||||||
|
if ($enabled === 'transitional') {
|
||||||
|
$qry .= ' AND user.inboxed = 1';
|
||||||
|
}
|
||||||
|
$inbox->query($qry);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,9 +394,13 @@ class Notice extends Memcached_DataObject
|
||||||
|
|
||||||
function blowInboxes() {
|
function blowInboxes() {
|
||||||
|
|
||||||
|
$enabled = common_config('inboxes', 'enabled');
|
||||||
|
|
||||||
|
if ($enabled === true || $enabled === 'transitional') {
|
||||||
$inbox = new Notice_inbox();
|
$inbox = new Notice_inbox();
|
||||||
$inbox->notice_id = $this->id;
|
$inbox->notice_id = $this->id;
|
||||||
$inbox->delete();
|
$inbox->delete();
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user