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 | 'contactRequests', |
||
24 | 'conversations', |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * @param int $limit |
||
29 | * @return Pagination |
||
30 | */ |
||
31 | public function news($limit = Pagination::DEFAULT_LIMIT) |
||
37 | |||
38 | /** |
||
39 | * @param int $limit |
||
40 | * @return Pagination |
||
41 | */ |
||
42 | public function notifications($limit = Pagination::DEFAULT_LIMIT) |
||
46 | |||
47 | /** |
||
48 | * Get last user conversations. |
||
49 | * |
||
50 | * @return array|bool |
||
51 | */ |
||
52 | public function conversations() |
||
56 | |||
57 | /** |
||
58 | * Send message to a user. |
||
59 | * |
||
60 | * @param array|string $userIds |
||
61 | * @param string $text |
||
62 | * @param int|null $pinId |
||
63 | * @throws InvalidRequest |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function sendMessage($userIds, $text, $pinId = null) |
||
70 | |||
71 | /** |
||
72 | * Send email. |
||
73 | * |
||
74 | * @param array|string $emails |
||
75 | * @param string $text |
||
76 | * @param int|null $pinId |
||
77 | * @throws InvalidRequest |
||
78 | * @return bool |
||
79 | */ |
||
80 | public function sendEmail($emails, $text, $pinId = null) |
||
84 | |||
85 | /** |
||
86 | * Get current contact requests. |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | public function contactRequests() |
||
96 | |||
97 | /** |
||
98 | * @param string $requestId |
||
99 | * @return bool |
||
100 | */ |
||
101 | public function acceptContactRequest($requestId) |
||
107 | |||
108 | /** |
||
109 | * @param string $requestId |
||
110 | * @return bool |
||
111 | */ |
||
112 | public function ignoreContactRequest($requestId) |
||
118 | |||
119 | /** |
||
120 | * @param string $requestId |
||
121 | * @param $endpoint |
||
122 | * @return bool |
||
123 | */ |
||
124 | protected function makeContactRequestCall($requestId, $endpoint) |
||
135 | } |
||
136 |