Finish Notifications -> Conversation
This commit is contained in:
@@ -49,8 +49,9 @@ class XenforoApiService {
|
||||
|
||||
public function getUserAlerts(int $userId): mixed
|
||||
{
|
||||
if( app(XenforoService::class)->getXfUser($userId)?->alerts_unviewed > 0 )
|
||||
return $this->get("alerts?page=1&cutoff=7days", $userId);
|
||||
if( app(XenforoService::class)->getXfUser($userId)?->alerts_unviewed > 0 ) {
|
||||
Cache::forget("xf_alerts_{$userId}");
|
||||
}
|
||||
|
||||
return Cache::remember("xf_alerts_{$userId}", 60, function() use($userId) {
|
||||
return $this->get("alerts?page=1&cutoff=7days", $userId);
|
||||
@@ -63,4 +64,11 @@ class XenforoApiService {
|
||||
$this->post("alerts/marl-all", $userId );
|
||||
}
|
||||
|
||||
public function getConversations(int $userId): mixed
|
||||
{
|
||||
return Cache::remember("xf_conversations_{$userId}", 60, function() use($userId) {
|
||||
return $this->get("conversations?page=1&receiver_id={$userId}", $userId);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user