Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tarun018
Copy link
Contributor

No description provided.

@tarun018 tarun018 force-pushed the RegisterSetNick branch 5 times, most recently from 296766a to e66b64d Compare July 18, 2017 20:07
/**
* Register nick with MIX Channel.
*/
virtual void registerNick(const std::string &nick) = 0;
Copy link
Contributor Author

@tarun018 tarun018 Jul 24, 2017

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.

Copy link
Collaborator

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.

@tarun018
Copy link
Contributor Author

Updated with discovery.

static const std::string InformationNode;
static const std::string AllowedNode;
static const std::string BannedNode;
static const std::string ConfigurationNode;
Copy link
Collaborator

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.


void MIXImpl::handleFeaturesReceived(DiscoInfo::ref payload, ErrorPayload::ref /*error*/) {
if (payload) {
assert(payload->getNode() == std::string("mix"));
Copy link
Collaborator

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.

Copy link
Contributor Author

@tarun018 tarun018 Jul 26, 2017

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.

onNickResponse(nick, error);
}

void MIXImpl::getSupportedFeatures() {
Copy link
Collaborator

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.


void MIXImpl::handleSupportedNodesReceived(DiscoItems::ref payload, ErrorPayload::ref /*error*/) {
if (payload) {
assert(payload->getNode() == std::string("mix"));
Copy link
Collaborator

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
@tarun018
Copy link
Contributor Author

Updated based on feedback.

@tarun018 tarun018 changed the title Add methods for setting and registering nick for MIX channel Add methods for discovery, setting and registering nick for MIX channel Aug 28, 2017
@tdemin
Copy link

tdemin commented Nov 14, 2017

wow, is Swift going to be the first client supporting MIX?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants