Changeset View
Changeset View
Standalone View
Standalone View
src/applications/feed/PhabricatorFeedStoryPublisher.php
| Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | if ($this->relatedPHIDs) { | ||||
| $conn, | $conn, | ||||
| '(%s, %s)', | '(%s, %s)', | ||||
| $phid, | $phid, | ||||
| $chrono_key); | $chrono_key); | ||||
| } | } | ||||
| queryfx( | queryfx( | ||||
| $conn, | $conn, | ||||
| 'INSERT INTO %T (objectPHID, chronologicalKey) VALUES %Q', | 'INSERT INTO %T (objectPHID, chronologicalKey) VALUES %LQ', | ||||
| $ref->getTableName(), | $ref->getTableName(), | ||||
| implode(', ', $sql)); | $sql); | ||||
| } | } | ||||
| $subscribed_phids = $this->subscribedPHIDs; | $subscribed_phids = $this->subscribedPHIDs; | ||||
| if ($subscribed_phids) { | if ($subscribed_phids) { | ||||
| $subscribed_phids = $this->filterSubscribedPHIDs($subscribed_phids); | $subscribed_phids = $this->filterSubscribedPHIDs($subscribed_phids); | ||||
| $this->insertNotifications($chrono_key, $subscribed_phids); | $this->insertNotifications($chrono_key, $subscribed_phids); | ||||
| $this->sendNotification($chrono_key, $subscribed_phids); | $this->sendNotification($chrono_key, $subscribed_phids); | ||||
| } | } | ||||
| Show All 39 Lines | foreach ($user_phids as $user_phid) { | ||||
| $mark_read); | $mark_read); | ||||
| } | } | ||||
| if ($sql) { | if ($sql) { | ||||
| queryfx( | queryfx( | ||||
| $conn, | $conn, | ||||
| 'INSERT INTO %T '. | 'INSERT INTO %T '. | ||||
| '(primaryObjectPHID, userPHID, chronologicalKey, hasViewed) '. | '(primaryObjectPHID, userPHID, chronologicalKey, hasViewed) '. | ||||
| 'VALUES %Q', | 'VALUES %LQ', | ||||
| $notif->getTableName(), | $notif->getTableName(), | ||||
| implode(', ', $sql)); | $sql); | ||||
| } | } | ||||
| PhabricatorUserCache::clearCaches( | PhabricatorUserCache::clearCaches( | ||||
| PhabricatorUserNotificationCountCacheType::KEY_COUNT, | PhabricatorUserNotificationCountCacheType::KEY_COUNT, | ||||
| $user_phids); | $user_phids); | ||||
| } | } | ||||
| private function sendNotification($chrono_key, array $subscribed_phids) { | private function sendNotification($chrono_key, array $subscribed_phids) { | ||||
| ▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines | |||||