Skip to content
Snippets Groups Projects
Commit d1c1b2b9 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

dbus: remove redundant class-name

Refs: #48032
parent 925c69cd
No related branches found
No related tags found
No related merge requests found
...@@ -146,64 +146,64 @@ DBusClient::~DBusClient() ...@@ -146,64 +146,64 @@ DBusClient::~DBusClient()
int DBusClient::initLibrary(int sflphFlags) int DBusClient::initLibrary(int sflphFlags)
{ {
if (!DBusClient::_lastDbusClient) { if (!_lastDbusClient) {
DBusClient::_lastDbusClient = this; _lastDbusClient = this;
} }
// Call event handlers // Call event handlers
sflph_call_ev_handlers callEvHandlers = { sflph_call_ev_handlers callEvHandlers = {
DBusClient::callOnStateChange, callOnStateChange,
DBusClient::callOnTransferFail, callOnTransferFail,
DBusClient::callOnTransferSuccess, callOnTransferSuccess,
DBusClient::callOnRecordPlaybackStopped, callOnRecordPlaybackStopped,
DBusClient::callOnVoiceMailNotify, callOnVoiceMailNotify,
DBusClient::callOnIncomingMessage, callOnIncomingMessage,
DBusClient::callOnIncomingCall, callOnIncomingCall,
DBusClient::callOnRecordPlaybackFilepath, callOnRecordPlaybackFilepath,
DBusClient::callOnConferenceCreated, callOnConferenceCreated,
DBusClient::callOnConferenceChanged, callOnConferenceChanged,
DBusClient::callOnUpdatePlaybackScale, callOnUpdatePlaybackScale,
DBusClient::callOnConferenceRemove, callOnConferenceRemove,
DBusClient::callOnNewCall, callOnNewCall,
DBusClient::callOnSipCallStateChange, callOnSipCallStateChange,
DBusClient::callOnRecordStateChange, callOnRecordStateChange,
DBusClient::callOnSecureSdesOn, callOnSecureSdesOn,
DBusClient::callOnSecureSdesOff, callOnSecureSdesOff,
DBusClient::callOnSecureZrtpOn, callOnSecureZrtpOn,
DBusClient::callOnSecureZrtpOff, callOnSecureZrtpOff,
DBusClient::callOnShowSas, callOnShowSas,
DBusClient::callOnZrtpNotSuppOther, callOnZrtpNotSuppOther,
DBusClient::callOnZrtpNegotiationFail, callOnZrtpNegotiationFail,
DBusClient::callOnRtcpReceiveReport, callOnRtcpReceiveReport,
}; };
// Configuration event handlers // Configuration event handlers
sflph_config_ev_handlers configEvHandlers = { sflph_config_ev_handlers configEvHandlers = {
DBusClient::configOnVolumeChange, configOnVolumeChange,
DBusClient::configOnAccountsChange, configOnAccountsChange,
DBusClient::configOnHistoryChange, configOnHistoryChange,
DBusClient::configOnStunStatusFail, configOnStunStatusFail,
DBusClient::configOnRegistrationStateChange, configOnRegistrationStateChange,
DBusClient::configOnSipRegistrationStateChange, configOnSipRegistrationStateChange,
DBusClient::configOnError, configOnError,
}; };
#ifdef SFL_PRESENCE #ifdef SFL_PRESENCE
// Presence event handlers // Presence event handlers
sflph_pres_ev_handlers presEvHandlers = { sflph_pres_ev_handlers presEvHandlers = {
DBusClient::presOnNewServerSubscriptionRequest, presOnNewServerSubscriptionRequest,
DBusClient::presOnServerError, presOnServerError,
DBusClient::presOnNewBuddyNotification, presOnNewBuddyNotification,
DBusClient::presOnSubscriptionStateChange, presOnSubscriptionStateChange,
}; };
#endif // SFL_PRESENCE #endif // SFL_PRESENCE
#ifdef SFL_VIDEO #ifdef SFL_VIDEO
// Video event handlers // Video event handlers
sflph_video_ev_handlers videoEvHandlers = { sflph_video_ev_handlers videoEvHandlers = {
DBusClient::videoOnDeviceEvent, videoOnDeviceEvent,
DBusClient::videoOnStartDecoding, videoOnStartDecoding,
DBusClient::videoOnStopDecoding, videoOnStopDecoding,
}; };
#endif // SFL_VIDEO #endif // SFL_VIDEO
...@@ -249,7 +249,7 @@ int DBusClient::event_loop() ...@@ -249,7 +249,7 @@ int DBusClient::event_loop()
int DBusClient::exit() int DBusClient::exit()
{ {
// Avoid libsflphone events from now on // Avoid libsflphone events from now on
DBusClient::_lastDbusClient = nullptr; _lastDbusClient = nullptr;
try { try {
dispatcher_->leave(); dispatcher_->leave();
...@@ -290,240 +290,240 @@ DBusVideoManager* DBusClient::getVideoManager() ...@@ -290,240 +290,240 @@ DBusVideoManager* DBusClient::getVideoManager()
void DBusClient::callOnStateChange(const std::string& call_id, const std::string& state) void DBusClient::callOnStateChange(const std::string& call_id, const std::string& state)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->callStateChanged(call_id, state); _lastDbusClient->getCallManager()->callStateChanged(call_id, state);
} }
} }
void DBusClient::callOnTransferFail(void) void DBusClient::callOnTransferFail(void)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->transferFailed(); _lastDbusClient->getCallManager()->transferFailed();
} }
} }
void DBusClient::callOnTransferSuccess(void) void DBusClient::callOnTransferSuccess(void)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->transferSucceeded(); _lastDbusClient->getCallManager()->transferSucceeded();
} }
} }
void DBusClient::callOnRecordPlaybackStopped(const std::string& path) void DBusClient::callOnRecordPlaybackStopped(const std::string& path)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->recordPlaybackStopped(path); _lastDbusClient->getCallManager()->recordPlaybackStopped(path);
} }
} }
void DBusClient::callOnVoiceMailNotify(const std::string& call_id, int nd_msg) void DBusClient::callOnVoiceMailNotify(const std::string& call_id, int nd_msg)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->voiceMailNotify(call_id, nd_msg); _lastDbusClient->getCallManager()->voiceMailNotify(call_id, nd_msg);
} }
} }
void DBusClient::callOnIncomingMessage(const std::string& id, const std::string& from, const std::string& msg) void DBusClient::callOnIncomingMessage(const std::string& id, const std::string& from, const std::string& msg)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->incomingMessage(id, from, msg); _lastDbusClient->getCallManager()->incomingMessage(id, from, msg);
} }
} }
void DBusClient::callOnIncomingCall(const std::string& account_id, const std::string& call_id, const std::string& from) void DBusClient::callOnIncomingCall(const std::string& account_id, const std::string& call_id, const std::string& from)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->incomingCall(account_id, call_id, from); _lastDbusClient->getCallManager()->incomingCall(account_id, call_id, from);
} }
} }
void DBusClient::callOnRecordPlaybackFilepath(const std::string& id, const std::string& filename) void DBusClient::callOnRecordPlaybackFilepath(const std::string& id, const std::string& filename)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->recordPlaybackFilepath(id, filename); _lastDbusClient->getCallManager()->recordPlaybackFilepath(id, filename);
} }
} }
void DBusClient::callOnConferenceCreated(const std::string& conf_id) void DBusClient::callOnConferenceCreated(const std::string& conf_id)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->conferenceCreated(conf_id); _lastDbusClient->getCallManager()->conferenceCreated(conf_id);
} }
} }
void DBusClient::callOnConferenceChanged(const std::string& conf_id, const std::string& state) void DBusClient::callOnConferenceChanged(const std::string& conf_id, const std::string& state)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->conferenceChanged(conf_id, state); _lastDbusClient->getCallManager()->conferenceChanged(conf_id, state);
} }
} }
void DBusClient::callOnUpdatePlaybackScale(const std::string& filepath, int position, int scale) void DBusClient::callOnUpdatePlaybackScale(const std::string& filepath, int position, int scale)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->updatePlaybackScale(filepath, position, scale); _lastDbusClient->getCallManager()->updatePlaybackScale(filepath, position, scale);
} }
} }
void DBusClient::callOnConferenceRemove(const std::string& conf_id) void DBusClient::callOnConferenceRemove(const std::string& conf_id)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->conferenceRemoved(conf_id); _lastDbusClient->getCallManager()->conferenceRemoved(conf_id);
} }
} }
void DBusClient::callOnNewCall(const std::string& account_id, const std::string& call_id, const std::string& to) void DBusClient::callOnNewCall(const std::string& account_id, const std::string& call_id, const std::string& to)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->newCallCreated(account_id, call_id, to); _lastDbusClient->getCallManager()->newCallCreated(account_id, call_id, to);
} }
} }
void DBusClient::callOnSipCallStateChange(const std::string& call_id, const std::string& state, int code) void DBusClient::callOnSipCallStateChange(const std::string& call_id, const std::string& state, int code)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->sipCallStateChanged(call_id, state, code); _lastDbusClient->getCallManager()->sipCallStateChanged(call_id, state, code);
} }
} }
void DBusClient::callOnRecordStateChange(const std::string& call_id, int state) void DBusClient::callOnRecordStateChange(const std::string& call_id, int state)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->recordingStateChanged(call_id, state); _lastDbusClient->getCallManager()->recordingStateChanged(call_id, state);
} }
} }
void DBusClient::callOnSecureSdesOn(const std::string& call_id) void DBusClient::callOnSecureSdesOn(const std::string& call_id)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->secureSdesOn(call_id); _lastDbusClient->getCallManager()->secureSdesOn(call_id);
} }
} }
void DBusClient::callOnSecureSdesOff(const std::string& call_id) void DBusClient::callOnSecureSdesOff(const std::string& call_id)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->secureSdesOff(call_id); _lastDbusClient->getCallManager()->secureSdesOff(call_id);
} }
} }
void DBusClient::callOnSecureZrtpOn(const std::string& call_id, const std::string& cipher) void DBusClient::callOnSecureZrtpOn(const std::string& call_id, const std::string& cipher)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->secureZrtpOn(call_id, cipher); _lastDbusClient->getCallManager()->secureZrtpOn(call_id, cipher);
} }
} }
void DBusClient::callOnSecureZrtpOff(const std::string& call_id) void DBusClient::callOnSecureZrtpOff(const std::string& call_id)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->secureZrtpOff(call_id); _lastDbusClient->getCallManager()->secureZrtpOff(call_id);
} }
} }
void DBusClient::callOnShowSas(const std::string& call_id, const std::string& sas, int verified) void DBusClient::callOnShowSas(const std::string& call_id, const std::string& sas, int verified)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->showSAS(call_id, sas, verified); _lastDbusClient->getCallManager()->showSAS(call_id, sas, verified);
} }
} }
void DBusClient::callOnZrtpNotSuppOther(const std::string& call_id) void DBusClient::callOnZrtpNotSuppOther(const std::string& call_id)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->zrtpNotSuppOther(call_id); _lastDbusClient->getCallManager()->zrtpNotSuppOther(call_id);
} }
} }
void DBusClient::callOnZrtpNegotiationFail(const std::string& call_id, const std::string& reason, const std::string& severity) void DBusClient::callOnZrtpNegotiationFail(const std::string& call_id, const std::string& reason, const std::string& severity)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->zrtpNegotiationFailed(call_id, reason, severity); _lastDbusClient->getCallManager()->zrtpNegotiationFailed(call_id, reason, severity);
} }
} }
void DBusClient::callOnRtcpReceiveReport(const std::string& call_id, const std::map<std::string, int>& stats) void DBusClient::callOnRtcpReceiveReport(const std::string& call_id, const std::map<std::string, int>& stats)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getCallManager()->onRtcpReportReceived(call_id, stats); _lastDbusClient->getCallManager()->onRtcpReportReceived(call_id, stats);
} }
} }
void DBusClient::configOnVolumeChange(const std::string& device, int value) void DBusClient::configOnVolumeChange(const std::string& device, int value)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getConfigurationManager()->volumeChanged(device, value); _lastDbusClient->getConfigurationManager()->volumeChanged(device, value);
} }
} }
void DBusClient::configOnAccountsChange(void) void DBusClient::configOnAccountsChange(void)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getConfigurationManager()->accountsChanged(); _lastDbusClient->getConfigurationManager()->accountsChanged();
} }
} }
void DBusClient::configOnHistoryChange(void) void DBusClient::configOnHistoryChange(void)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getConfigurationManager()->historyChanged(); _lastDbusClient->getConfigurationManager()->historyChanged();
} }
} }
void DBusClient::configOnStunStatusFail(const std::string& account_id) void DBusClient::configOnStunStatusFail(const std::string& account_id)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getConfigurationManager()->stunStatusFailure(account_id); _lastDbusClient->getConfigurationManager()->stunStatusFailure(account_id);
} }
} }
void DBusClient::configOnRegistrationStateChange(const std::string& account_id, int state) void DBusClient::configOnRegistrationStateChange(const std::string& account_id, int state)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getConfigurationManager()->registrationStateChanged(account_id, state); _lastDbusClient->getConfigurationManager()->registrationStateChanged(account_id, state);
} }
} }
void DBusClient::configOnSipRegistrationStateChange(const std::string& account_id, const std::string& state, int code) void DBusClient::configOnSipRegistrationStateChange(const std::string& account_id, const std::string& state, int code)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getConfigurationManager()->sipRegistrationStateChanged(account_id, state, code); _lastDbusClient->getConfigurationManager()->sipRegistrationStateChanged(account_id, state, code);
} }
} }
void DBusClient::configOnError(int alert) void DBusClient::configOnError(int alert)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getConfigurationManager()->errorAlert(alert); _lastDbusClient->getConfigurationManager()->errorAlert(alert);
} }
} }
#ifdef SFL_PRESENCE #ifdef SFL_PRESENCE
void DBusClient::presOnNewServerSubscriptionRequest(const std::string& remote) void DBusClient::presOnNewServerSubscriptionRequest(const std::string& remote)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getPresenceManager()->newServerSubscriptionRequest(remote); _lastDbusClient->getPresenceManager()->newServerSubscriptionRequest(remote);
} }
} }
void DBusClient::presOnServerError(const std::string& account_id, const std::string& error, const std::string& msg) void DBusClient::presOnServerError(const std::string& account_id, const std::string& error, const std::string& msg)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getPresenceManager()->serverError(account_id, error, msg); _lastDbusClient->getPresenceManager()->serverError(account_id, error, msg);
} }
} }
void DBusClient::presOnNewBuddyNotification(const std::string& account_id, const std::string& buddy_uri, int status, const std::string& line_status) void DBusClient::presOnNewBuddyNotification(const std::string& account_id, const std::string& buddy_uri, int status, const std::string& line_status)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getPresenceManager()->newBuddyNotification(account_id, buddy_uri, status, line_status); _lastDbusClient->getPresenceManager()->newBuddyNotification(account_id, buddy_uri, status, line_status);
} }
} }
void DBusClient::presOnSubscriptionStateChange(const std::string& account_id, const std::string& buddy_uri, int state) void DBusClient::presOnSubscriptionStateChange(const std::string& account_id, const std::string& buddy_uri, int state)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getPresenceManager()->subscriptionStateChanged(account_id, buddy_uri, state); _lastDbusClient->getPresenceManager()->subscriptionStateChanged(account_id, buddy_uri, state);
} }
} }
#endif // SFL_PRESENCE #endif // SFL_PRESENCE
...@@ -531,22 +531,22 @@ void DBusClient::presOnSubscriptionStateChange(const std::string& account_id, co ...@@ -531,22 +531,22 @@ void DBusClient::presOnSubscriptionStateChange(const std::string& account_id, co
#ifdef SFL_VIDEO #ifdef SFL_VIDEO
void DBusClient::videoOnDeviceEvent(void) void DBusClient::videoOnDeviceEvent(void)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getVideoManager()->deviceEvent(); _lastDbusClient->getVideoManager()->deviceEvent();
} }
} }
void DBusClient::videoOnStartDecoding(const std::string& id, const std::string& shm_path, int w, int h, bool is_mixer) void DBusClient::videoOnStartDecoding(const std::string& id, const std::string& shm_path, int w, int h, bool is_mixer)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getVideoManager()->startedDecoding(id, shm_path, w, h, is_mixer); _lastDbusClient->getVideoManager()->startedDecoding(id, shm_path, w, h, is_mixer);
} }
} }
void DBusClient::videoOnStopDecoding(const std::string& id, const std::string& shm_path, bool is_mixer) void DBusClient::videoOnStopDecoding(const std::string& id, const std::string& shm_path, bool is_mixer)
{ {
if (DBusClient::_lastDbusClient) { if (_lastDbusClient) {
DBusClient::_lastDbusClient->getVideoManager()->stoppedDecoding(id, shm_path, is_mixer); _lastDbusClient->getVideoManager()->stoppedDecoding(id, shm_path, is_mixer);
} }
} }
#endif // SFL_VIDEO #endif // SFL_VIDEO
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment