summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client/CoreClient.h')
-rw-r--r--Swiften/Client/CoreClient.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h
index 4170e8d..3176a51 100644
--- a/Swiften/Client/CoreClient.h
+++ b/Swiften/Client/CoreClient.h
@@ -32,6 +32,7 @@ namespace Swift {
class ClientSession;
class BasicSessionStream;
class EventLoop;
+ class SecurityError;
/**
* The central class for communicating with an XMPP server.
@@ -71,6 +72,14 @@ namespace Swift {
void connect(const String& host);
/**
+ * Instructs the client to continue initializing the session
+ * after a security error has occurred (and as such ignoring the error)
+ *
+ * \see onSecurityError
+ */
+ void continueAfterSecurityError();
+
+ /**
* Sends a message.
*/
void sendMessage(Message::ref);
@@ -131,8 +140,29 @@ namespace Swift {
return stanzaChannel_;
}
+ /**
+ * Sets whether security errors should be ignored or not.
+ *
+ * If this is set to 'true', onSecurityError will not be called when a security
+ * error occurs, and connecting will continue.
+ *
+ * Defaults to true.
+ */
+ void setIgnoreSecurityErrors(bool b) {
+ ignoreSecurityErrors = b;
+ }
+
public:
/**
+ * Emitted when an error occurred while establishing a secure connection.
+ *
+ * If the error is to be ignored, call continueAfterSecurityError(), otherwise call
+ * finish().
+ * This signal is not emitted when setIgnoreSecurityErrors() is set to true.
+ */
+ boost::signal<void (const SecurityError&)> onSecurityError;
+
+ /**
* Emitted when the client was disconnected from the network.
*
* If the connection was due to a non-recoverable error, the type
@@ -187,6 +217,7 @@ namespace Swift {
void handleNeedCredentials();
void handleDataRead(const String&);
void handleDataWritten(const String&);
+ void handleSecurityError(const SecurityError& securityError);
private:
PlatformDomainNameResolver resolver_;
@@ -206,5 +237,6 @@ namespace Swift {
boost::shared_ptr<ClientSession> session_;
String certificate_;
bool disconnectRequested_;
+ bool ignoreSecurityErrors;
};
}