diff options
Diffstat (limited to 'Swiften')
| -rw-r--r-- | Swiften/Component/CoreComponent.cpp | 10 | ||||
| -rw-r--r-- | Swiften/Component/CoreComponent.h | 17 |
2 files changed, 22 insertions, 5 deletions
diff --git a/Swiften/Component/CoreComponent.cpp b/Swiften/Component/CoreComponent.cpp index 3896bdd..5b2277b 100644 --- a/Swiften/Component/CoreComponent.cpp +++ b/Swiften/Component/CoreComponent.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2016 Isode Limited. | 2 | * Copyright (c) 2010-2018 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| @@ -166,4 +166,12 @@ void CoreComponent::sendData(const std::string& data) { | |||
| 166 | sessionStream_->writeData(data); | 166 | sessionStream_->writeData(data); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | bool CoreComponent::isActive() const { | ||
| 170 | return session_ || connector_; | ||
| 171 | } | ||
| 172 | |||
| 173 | bool CoreComponent::isAvailable() const { | ||
| 174 | return stanzaChannel_->isAvailable(); | ||
| 175 | } | ||
| 176 | |||
| 169 | } | 177 | } |
diff --git a/Swiften/Component/CoreComponent.h b/Swiften/Component/CoreComponent.h index f673643..1a487d2 100644 --- a/Swiften/Component/CoreComponent.h +++ b/Swiften/Component/CoreComponent.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2017 Isode Limited. | 2 | * Copyright (c) 2010-2018 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| @@ -61,9 +61,18 @@ namespace Swift { | |||
| 61 | return stanzaChannel_; | 61 | return stanzaChannel_; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | bool isAvailable() const { | 64 | /** |
| 65 | return stanzaChannel_->isAvailable(); | 65 | * Checks whether the component is connected to the server, |
| 66 | } | 66 | * and stanzas can be sent. |
| 67 | */ | ||
| 68 | bool isAvailable() const; | ||
| 69 | |||
| 70 | /** | ||
| 71 | * Checks whether the component is active. | ||
| 72 | * | ||
| 73 | * A component is active when it is connected or connecting to the server. | ||
| 74 | */ | ||
| 75 | bool isActive() const; | ||
| 67 | 76 | ||
| 68 | /** | 77 | /** |
| 69 | * Returns the JID of the component | 78 | * Returns the JID of the component |
Swift