fix(llc): pass includeUserDetailsInConnectCall to WS
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user