Skip to content

Commit

Permalink
Include whether we're using a headers login in CONNECTED bridge state
Browse files Browse the repository at this point in the history
  • Loading branch information
bradtgmurray committed Jan 30, 2024
1 parent 5700a95 commit 73a5179
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion linkedin_matrix/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,10 @@ async def _push_connected_state(self):
# We haven't sent a CONNECTED state in the last 12 hours.
or self._prev_connected_bridge_state + (12 * 60 * 60) < time.monotonic()
):
await self.push_bridge_state(BridgeStateEvent.CONNECTED)
await self.push_bridge_state(
BridgeStateEvent.CONNECTED,
info={"using_headers_from_user": self.client.using_headers_from_user},
)
self._prev_connected_bridge_state = time.monotonic()
else:
self.log.trace("Event received on event stream, but not sending CONNECTED")
Expand Down
3 changes: 3 additions & 0 deletions linkedin_messaging/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class LinkedInMessaging:
]
headers: dict[str, str]

using_headers_from_user = False

_realtime_session_id: uuid.UUID
_realtime_connection_id: Optional[uuid.UUID] = None

Expand All @@ -149,6 +151,7 @@ def from_cookies_and_headers(cookies: dict[str, str],

if headers:
linkedin.headers = headers
linkedin.using_headers_from_user = True
else:
linkedin.headers = fallback_headers
linkedin.update_headers_from_cookies()
Expand Down

0 comments on commit 73a5179

Please sign in to comment.