@@ -544,77 +544,77 @@ public function unmute(string $userId): StreamResponse
544544 ];
545545 return $ this ->client ->post ("moderation/unmute/channel " , $ postData );
546546 }
547- }
548547
549- /** Pins the channel for the user.
550- * @throws StreamException
551- */
552- public function pin (string $ userId ): StreamResponse
553- {
554- if (empty ($ userId )) {
555- throw new StreamException ("user ID must be not empty " );
548+ /** Pins the channel for the user.
549+ * @throws StreamException
550+ */
551+ public function pin (string $ userId ): StreamResponse
552+ {
553+ if (empty ($ userId )) {
554+ throw new StreamException ("user ID must be not empty " );
555+ }
556+
557+ $ payload = [
558+ "set " => [
559+ "pinned " => true
560+ ]
561+ ];
562+
563+ return $ this ->client ->patch ($ this ->getUrl () . "/member/ " . urlencode ($ userId ), $ payload );
556564 }
557565
558- $ payload = [
559- "set " => [
560- "pinned " => true
561- ]
562- ];
563566
564- return $ this ->client ->patch ($ this ->getUrl () . "/member/ " . urlencode ($ userId ), $ payload );
565- }
567+ /** Unpins the channel for the user.
568+ * @throws StreamException
569+ */
570+ public function unpin (string $ userId ): StreamResponse
571+ {
572+ if (empty ($ userId )) {
573+ throw new StreamException ("user ID must be not empty " );
574+ }
566575
576+ $ payload = [
577+ "set " => [
578+ "pinned " => false
579+ ]
580+ ];
567581
568- /** Unpins the channel for the user.
569- * @throws StreamException
570- */
571- public function unpin (string $ userId ): StreamResponse
572- {
573- if (empty ($ userId )) {
574- throw new StreamException ("user ID must be not empty " );
582+ return $ this ->client ->patch ($ this ->getUrl () . "/member/ " . urlencode ($ userId ), $ payload );
575583 }
576584
577- $ payload = [
578- "set " => [
579- "pinned " => false
580- ]
581- ];
585+ /** Archives the channel for the user.
586+ * @throws StreamException
587+ */
588+ public function pin (string $ userId ): StreamResponse
589+ {
590+ if (empty ($ userId )) {
591+ throw new StreamException ("user ID must be not empty " );
592+ }
582593
583- return $ this ->client ->patch ($ this ->getUrl () . "/member/ " . urlencode ($ userId ), $ payload );
584- }
594+ $ payload = [
595+ "set " => [
596+ "archived " => true
597+ ]
598+ ];
585599
586- /** Archives the channel for the user.
587- * @throws StreamException
588- */
589- public function pin (string $ userId ): StreamResponse
590- {
591- if (empty ($ userId )) {
592- throw new StreamException ("user ID must be not empty " );
600+ return $ this ->client ->patch ($ this ->getUrl () . "/member/ " . urlencode ($ userId ), $ payload );
593601 }
594602
595- $ payload = [
596- "set " => [
597- "archived " => true
598- ]
599- ];
603+ /** Unarchives the channel for the user.
604+ * @throws StreamException
605+ */
606+ public function pin (string $ userId ): StreamResponse
607+ {
608+ if (empty ($ userId )) {
609+ throw new StreamException ("user ID must be not empty " );
610+ }
600611
601- return $ this ->client ->patch ($ this ->getUrl () . "/member/ " . urlencode ($ userId ), $ payload );
602- }
612+ $ payload = [
613+ "set " => [
614+ "archived " => false
615+ ]
616+ ];
603617
604- /** Unarchives the channel for the user.
605- * @throws StreamException
606- */
607- public function pin (string $ userId ): StreamResponse
608- {
609- if (empty ($ userId )) {
610- throw new StreamException ("user ID must be not empty " );
618+ return $ this ->client ->patch ($ this ->getUrl () . "/member/ " . urlencode ($ userId ), $ payload );
611619 }
612-
613- $ payload = [
614- "set " => [
615- "archived " => false
616- ]
617- ];
618-
619- return $ this ->client ->patch ($ this ->getUrl () . "/member/ " . urlencode ($ userId ), $ payload );
620620}
0 commit comments