fix(llc): pass includeUserDetailsInConnectCall to WS

This commit is contained in:
Salvatore Giordano
2022-04-12 15:24:17 +02:00
parent 748f4bd1b6
commit d7ee768a83
2 changed files with 11 additions and 7 deletions
@@ -377,11 +377,10 @@ class StreamChatClient {
_ws.connectionStatusStream.skip(1).listen(_connectionStatusHandler); _ws.connectionStatusStream.skip(1).listen(_connectionStatusHandler);
try { try {
final event = await _ws.connect(includeUserDetailsInConnectCall final event = await _ws.connect(
? user user,
: User( includeUserDetails: includeUserDetailsInConnectCall,
id: user.id, );
));
return user.merge(event.me); return user.merge(event.me);
} catch (e, stk) { } catch (e, stk) {
logger.severe('error connecting ws', e, stk); logger.severe('error connecting ws', e, stk);
@@ -179,7 +179,10 @@ class WebSocket with TimerHelper {
bool _connectRequestInProgress = false; bool _connectRequestInProgress = false;
/// Connect the WS using the parameters passed in the constructor /// Connect the WS using the parameters passed in the constructor
Future<Event> connect(User user) async { Future<Event> connect(
User user, {
bool includeUserDetails = false,
}) async {
if (_connectRequestInProgress) { if (_connectRequestInProgress) {
throw const StreamWebSocketError(''' throw const StreamWebSocketError('''
You've called connect twice, You've called connect twice,
@@ -194,7 +197,9 @@ class WebSocket with TimerHelper {
connectionCompleter = Completer<Event>(); connectionCompleter = Completer<Event>();
try { try {
final uri = await _buildUri(); final uri = await _buildUri(
includeUserDetails: includeUserDetails,
);
_initWebSocketChannel(uri); _initWebSocketChannel(uri);
} catch (e, stk) { } catch (e, stk) {
_onConnectionError(e, stk); _onConnectionError(e, stk);