1 | <?php |
||
11 | class Inbox extends Provider |
||
12 | { |
||
13 | use SendsMessages; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $loginRequiredFor = [ |
||
19 | 'news', |
||
20 | 'sendEmail', |
||
21 | 'sendMessage', |
||
22 | 'notifications', |
||
23 | 'conversations', |
||
24 | ]; |
||
25 | |||
26 | /** |
||
27 | * @param int $limit |
||
28 | * @return Pagination |
||
29 | */ |
||
30 | public function news($limit = Pagination::DEFAULT_LIMIT) |
||
36 | |||
37 | /** |
||
38 | * @param int $limit |
||
39 | * @return Pagination |
||
40 | */ |
||
41 | public function notifications($limit = Pagination::DEFAULT_LIMIT) |
||
45 | |||
46 | /** |
||
47 | * Get last user conversations. |
||
48 | * |
||
49 | * @return array|bool |
||
50 | */ |
||
51 | public function conversations() |
||
55 | |||
56 | /** |
||
57 | * Send message to a user. |
||
58 | * |
||
59 | * @param array|string $userIds |
||
60 | * @param string $text |
||
61 | * @param int|null $pinId |
||
62 | * @throws InvalidRequest |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function sendMessage($userIds, $text, $pinId = null) |
||
69 | |||
70 | /** |
||
71 | * Send email. |
||
72 | * |
||
73 | * @param array|string $emails |
||
74 | * @param string $text |
||
75 | * @param int|null $pinId |
||
76 | * @throws InvalidRequest |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function sendEmail($emails, $text, $pinId = null) |
||
83 | |||
84 | public function contactRequests() |
||
90 | |||
91 | /** |
||
92 | * @param string $requestId |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function acceptContactRequest($requestId) |
||
101 | |||
102 | /** |
||
103 | * @param string $requestId |
||
104 | * @return bool |
||
105 | */ |
||
106 | public function ignoreContactRequests($requestId) |
||
112 | |||
113 | /** |
||
114 | * @param string $requestId |
||
115 | * @param $endpoint |
||
116 | * @return bool |
||
117 | */ |
||
118 | protected function makeContactRequestCall($requestId, $endpoint) |
||
129 | } |
||
130 |