| xqd
@@ -26,6 +26,8 @@ class TencentImFriendService
|
|
|
'friendAddItem' => 'v4/sns/friend_add', //单个添加好友,
|
|
|
'friendGet' => 'v4/sns/friend_get', //拉取好友,
|
|
|
'friendCheck' => 'v4/sns/friend_check', //校验好友
|
|
|
+ 'black_add' => 'v4/sns/black_list_add', //拉黑好友
|
|
|
+ 'black_del' => 'v4/sns/black_list_delete', //删除拉黑好友
|
|
|
];
|
|
|
|
|
|
static public function verifyUserApplyFriendExists(User $fromUser, User $toUser)
|
| xqd
@@ -215,4 +217,30 @@ class TencentImFriendService
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //拉黑
|
|
|
+ public function friend_black_add(string $fromAccount, string $toAccount)
|
|
|
+ {
|
|
|
+ $this->restApiName = self::TENCENT_REST_APIS['black_add'];
|
|
|
+ $baseApiHost = $this->getTencentImRestApiBaseHost();
|
|
|
+ $params = [
|
|
|
+ 'From_Account' => $fromAccount,
|
|
|
+ 'To_Account' => $toAccount,
|
|
|
+ ];
|
|
|
+ $apiResult = $this->requestApi($baseApiHost, $params);
|
|
|
+ return $apiResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ //取消拉黑
|
|
|
+ public function friend_black_del(string $fromAccount, string $toAccount)
|
|
|
+ {
|
|
|
+ $this->restApiName = self::TENCENT_REST_APIS['black_del'];
|
|
|
+ $baseApiHost = $this->getTencentImRestApiBaseHost();
|
|
|
+ $params = [
|
|
|
+ 'From_Account' => $fromAccount,
|
|
|
+ 'To_Account' => $toAccount,
|
|
|
+ ];
|
|
|
+ $apiResult = $this->requestApi($baseApiHost, $params);
|
|
|
+ return $apiResult;
|
|
|
+ }
|
|
|
+
|
|
|
}
|