diff options
-rw-r--r-- | Sluift/ElementConvertors/StatusShowConvertor.cpp | 12 | ||||
-rw-r--r-- | Sluift/Helpers.cpp | 35 | ||||
-rw-r--r-- | Sluift/Helpers.h | 1 | ||||
-rw-r--r-- | Sluift/SluiftComponent.cpp | 2 | ||||
-rw-r--r-- | Sluift/SluiftComponent.h | 1 | ||||
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 1 |
6 files changed, 26 insertions, 26 deletions
diff --git a/Sluift/ElementConvertors/StatusShowConvertor.cpp b/Sluift/ElementConvertors/StatusShowConvertor.cpp index d8e24ab..27876ff 100644 --- a/Sluift/ElementConvertors/StatusShowConvertor.cpp +++ b/Sluift/ElementConvertors/StatusShowConvertor.cpp @@ -42,10 +42,10 @@ void StatusShowConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<StatusS std::string StatusShowConvertor::convertStatusShowTypeToString(const StatusShow::Type &show) { switch (show) { - case StatusShow::Online: return "online"; break; - case StatusShow::FFC: return "ffc"; break; - case StatusShow::Away: return "away"; break; - case StatusShow::XA: return "xa"; break; - case StatusShow::DND: return "dnd"; break; - case StatusShow::None: return ""; break; + case StatusShow::Online: return "online"; + case StatusShow::FFC: return "ffc"; + case StatusShow::Away: return "away"; + case StatusShow::XA: return "xa"; + case StatusShow::DND: return "dnd"; + case StatusShow::None: return ""; } assert(false); diff --git a/Sluift/Helpers.cpp b/Sluift/Helpers.cpp index 29e2b04..756ae59 100644 --- a/Sluift/Helpers.cpp +++ b/Sluift/Helpers.cpp @@ -12,21 +12,14 @@ using namespace Swift; -template<class T> std::string Swift::getCommonErrorString(T& error) { - std::string reason = "Disconnected: "; - switch(error.getType()) { - case T::UnknownError: reason += "Unknown Error"; break; - case T::ConnectionError: reason += "Error connecting to server"; break; - case T::ConnectionReadError: reason += "Error while receiving server data"; break; - case T::ConnectionWriteError: reason += "Error while sending data to the server"; break; - case T::XMLError: reason += "Error parsing server data"; break; - case T::AuthenticationFailedError: reason += "Login/password invalid"; break; - case T::UnexpectedElementError: reason += "Unexpected response"; break; - } - return reason; -} - std::string Swift::getErrorString(const ClientError& error) { - std::string reason = getCommonErrorString(error); + std::string reason = "Disconnected: "; switch(error.getType()) { + case ClientError::UnknownError: reason += "Unknown Error"; break; + case ClientError::ConnectionError: reason += "Error connecting to server"; break; + case ClientError::ConnectionReadError: reason += "Error while receiving server data"; break; + case ClientError::ConnectionWriteError: reason += "Error while sending data to the server"; break; + case ClientError::XMLError: reason += "Error parsing server data"; break; + case ClientError::AuthenticationFailedError: reason += "Login/password invalid"; break; + case ClientError::UnexpectedElementError: reason += "Unexpected response"; break; case ClientError::DomainNameResolveError: reason += "Unable to find server"; break; case ClientError::CompressionFailedError: reason += "Error while compressing stream"; break; @@ -58,5 +51,15 @@ std::string Swift::getErrorString(const ClientError& error) { std::string Swift::getErrorString(const ComponentError& error) { - return getCommonErrorString(error); + std::string reason = "Disconnected: "; + switch(error.getType()) { + case ComponentError::UnknownError: reason += "Unknown Error"; break; + case ComponentError::ConnectionError: reason += "Error connecting to server"; break; + case ComponentError::ConnectionReadError: reason += "Error while receiving server data"; break; + case ComponentError::ConnectionWriteError: reason += "Error while sending data to the server"; break; + case ComponentError::XMLError: reason += "Error parsing server data"; break; + case ComponentError::AuthenticationFailedError: reason += "Login/password invalid"; break; + case ComponentError::UnexpectedElementError: reason += "Unexpected response"; break; + } + return reason; } diff --git a/Sluift/Helpers.h b/Sluift/Helpers.h index d04a610..157e116 100644 --- a/Sluift/Helpers.h +++ b/Sluift/Helpers.h @@ -16,5 +16,4 @@ namespace Swift { class ComponentError; - template<typename T> std::string getCommonErrorString(T& error); std::string getErrorString(const ClientError& error); std::string getErrorString(const ComponentError& error); diff --git a/Sluift/SluiftComponent.cpp b/Sluift/SluiftComponent.cpp index c08a103..c8a17a7 100644 --- a/Sluift/SluiftComponent.cpp +++ b/Sluift/SluiftComponent.cpp @@ -80,5 +80,5 @@ void SluiftComponent::disconnect() { } -void SluiftComponent::setSoftwareVersion(const std::string& name, const std::string& version, const std::string& os) { +void SluiftComponent::setSoftwareVersion(const std::string& name, const std::string& version, const std::string& /* os */) { component->setSoftwareVersion(name, version); } diff --git a/Sluift/SluiftComponent.h b/Sluift/SluiftComponent.h index 3d5792b..ba848e1 100644 --- a/Sluift/SluiftComponent.h +++ b/Sluift/SluiftComponent.h @@ -99,5 +99,4 @@ namespace Swift { Component* component; ComponentXMLTracer* tracer; - bool rosterReceived; std::deque<Event> pendingEvents; boost::optional<ComponentError> disconnectedError; diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index 32e25a2..3ff2a3d 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -398,5 +398,4 @@ ChatListWindow::Chat ChatsManager::createChatListChatItem(const JID& jid, const if (controller->isImpromptu()) { ChatListWindow::Chat chat = ChatListWindow::Chat(jid, jid.toString(), activity, unreadCount, type, boost::filesystem::path(), true, privateMessage, nick, password); - typedef std::pair<std::string, JID> StringJIDPair; std::map<std::string, JID> participants = controller->getParticipantJIDs(); chat.impromptuJIDs = participants; |