-
Notifications
You must be signed in to change notification settings - Fork 0
Add Connection Status Listener. Add functions to Reconnect and Disconnect all subscriptions. #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/infra/pubnub.cpp
Outdated
{ | ||
PubNub* PubnubObject = static_cast<PubNub*>(_data); | ||
if(!PubnubObject || !PubnubObject->status_listener) | ||
{ | ||
return; | ||
} | ||
|
||
//Don't call the listener if the subscription status is changed - this type is not supported in Chat SDK | ||
if(status == PNSS_SUBSCRIPTION_STATUS_SUBSCRIPTION_CHANGED) | ||
{ | ||
return; | ||
} | ||
else | ||
{ | ||
Pubnub::ConnectionStatusData data; | ||
data.reason = pubnub_res_2_string(status_data.reason); | ||
PubnubObject->status_listener(PubNub::pn_subscription_status_to_connection_status(status), data); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be a part of the CallbackService?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to CallbackService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - however that would be nice to format the codebase.
add(subscribe): Add Connection Status Listener, so user can react to connection errors.
add(subscribe): Add functions to Reconnect and Disconnect all subscriptions.