diff options
Diffstat (limited to 'Swiften/Component/CoreComponent.h')
-rw-r--r-- | Swiften/Component/CoreComponent.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Swiften/Component/CoreComponent.h b/Swiften/Component/CoreComponent.h index f673643..7565d00 100644 --- a/Swiften/Component/CoreComponent.h +++ b/Swiften/Component/CoreComponent.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2017 Isode Limited. + * Copyright (c) 2010-2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -46,7 +46,7 @@ namespace Swift { CoreComponent(const JID& jid, const std::string& secret, NetworkFactories* networkFactories); virtual ~CoreComponent(); - void connect(const std::string& host, int port); + void connect(const std::string& host, unsigned short port); void disconnect(); void sendMessage(std::shared_ptr<Message>); @@ -61,9 +61,18 @@ namespace Swift { return stanzaChannel_; } - bool isAvailable() const { - return stanzaChannel_->isAvailable(); - } + /** + * Checks whether the component is connected to the server, + * and stanzas can be sent. + */ + bool isAvailable() const; + + /** + * Checks whether the component is active. + * + * A component is active when it is connected or connecting to the server. + */ + bool isActive() const; /** * Returns the JID of the component |