-
Notifications
You must be signed in to change notification settings - Fork 65
Add methods for discovery, setting and registering nick for MIX channel #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
296766a to
e66b64d
Compare
e66b64d to
1ad4ccd
Compare
Swiften/MIX/MIX.h
Outdated
| /** | ||
| * Register nick with MIX Channel. | ||
| */ | ||
| virtual void registerNick(const std::string &nick) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure whether disco query needs to be done before (May be done in controllers ?) Example 40 in MIX XEP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd think it would make sense to have Swiften::MIX deal with that and tell its user what features are supported. Probably makes sense to do that early in the beginning.
1ad4ccd to
097aaad
Compare
|
Updated with discovery. |
| static const std::string InformationNode; | ||
| static const std::string AllowedNode; | ||
| static const std::string BannedNode; | ||
| static const std::string ConfigurationNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you sort these alphabetically.
Swiften/MIX/MIXImpl.cpp
Outdated
|
|
||
| void MIXImpl::handleFeaturesReceived(DiscoInfo::ref payload, ErrorPayload::ref /*error*/) { | ||
| if (payload) { | ||
| assert(payload->getNode() == std::string("mix")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't want to exit the program in case we don't receive a payload with node "mix" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for using assert was "All disco queries on a MIX channel and results returned MUST include the attribute node='mix' " as stated in XEP.
https://xmpp.org/extensions/xep-0369.html#find-channel-info
However using SWIFT_LOG_ASSERT seems sensible.
Swiften/MIX/MIXImpl.cpp
Outdated
| onNickResponse(nick, error); | ||
| } | ||
|
|
||
| void MIXImpl::getSupportedFeatures() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get*naming for methods that aren't getters and return things feels strange. Maybe use request*instead or so.
Swiften/MIX/MIXImpl.cpp
Outdated
|
|
||
| void MIXImpl::handleSupportedNodesReceived(DiscoItems::ref payload, ErrorPayload::ref /*error*/) { | ||
| if (payload) { | ||
| assert(payload->getNode() == std::string("mix")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use SWIFT_LOG_ASSERT instead, which only writes a message and doesn't exit the program on condition. Same goes for the other assert usages in MIXImpl.cpp.
Add querying channel for supported features, supported MIX nodes and channel information. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for registering and setting nicks as in XEP-0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: Ibc2737f6154eeee1a85e98cb5f80c8bdbad35dcd
097aaad to
f9fa71e
Compare
|
Updated based on feedback. |
|
wow, is Swift going to be the first client supporting MIX? |
No description provided.