Description: Send token and cookie when connecting to the websocket as well
 Now slack is requiring those headers to be set on the websocket as well.
 .
 They used to be needed just on the normal REST API calls.
 .
 The patch is a backport from upstream.
 .
 localslackirc (1.17-1.1+deb12u1) bookworm; urgency=medium
 .
   * Backport patch to send authorization and cookie headers to the websocket
Author: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
Origin: upstream
Forwarded: not-needed
Applied-Upstream: 1.19, https://github.com/ltworf/localslackirc/pull/426/commits/6a7eafb6d33b997ed61331e4f26264e6d4ddf66c
Last-Update: 2023-10-24

--- localslackirc-1.17.orig/slackclient/client.py
+++ localslackirc-1.17/slackclient/client.py
@@ -124,7 +124,13 @@ class SlackClient:
             timeout: in seconds
         """
         r = await self.login()
-        self._websocket = await wsconnect(r.url, close_timeout=0.2)
+        headers = {
+            'user-agent': 'localslackirc',
+            'Authorization': f'Bearer {self._token}',
+        }
+        if self._cookie:
+            headers['cookie'] = self._cookie
+        self._websocket = await wsconnect(r.url, close_timeout=0.2, extra_headers=headers)
         return r
 
 
