Skip to content
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

Retrieve Participant List, Send Message to Channel and Real JID lookup of participants proxy JID #89

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated based on feedback
Change-Id: I98bda1d18847cd1fabffde2c0f92fced31d2a5f3
  • Loading branch information
tarun018 committed Aug 22, 2017
commit 829213a0c81891df3053a7de166ec514b006ad7e
6 changes: 3 additions & 3 deletions Limber/MIXMockServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ class Server {
//If request comes to particular channel supported by service.
handleElementReceivedForMIXChannel(iq, session);
} else if (stanza->getTo() == session->getLocalJID()) {
//If request comes to domain service
//If request comes to domain service.
handleElementReceivedForMIXService(iq, session);
} else if (stanza->getTo() == session->getRemoteJID().toBare() || stanza->getTo() == JID()) {
//If request comes to own local server
//If request comes to own account.
handleElementReceivedForAccount(iq, session);
}
}
Expand Down Expand Up @@ -229,7 +229,7 @@ class Server {
return joinResultPayload;
}

std::shared_ptr<RosterPayload> getRosterPayloadFromXMPPRoster(std::shared_ptr<XMPPRosterImpl> roster) {
static std::shared_ptr<RosterPayload> getRosterPayloadFromXMPPRoster(std::shared_ptr<XMPPRosterImpl> roster) {
auto rosterPayload = std::make_shared<RosterPayload>();
for (auto item : roster->getItems()) {
auto itemPayload = RosterItemPayload(item.getJID(), item.getName(), item.getSubscription());
Expand Down
18 changes: 9 additions & 9 deletions Swiften/Examples/MIXListAndJoin/MIXListAndJoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/

#include <cassert>
#include <iostream>
#include <memory>
#include <unordered_set>

#include <boost/optional.hpp>

#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Elements/ErrorPayload.h>
#include <Swiften/Elements/MIXParticipant.h>
#include <Swiften/Base/Log.h>
#include <Swiften/Client/Client.h>
#include <Swiften/Client/ClientOptions.h>
#include <Swiften/Client/ClientXMLTracer.h>
#include <Swiften/Disco/GetDiscoItemsRequest.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Elements/ErrorPayload.h>
#include <Swiften/Elements/MIXParticipant.h>
#include <Swiften/EventLoop/SimpleEventLoop.h>
#include <Swiften/JID/JID.h>
#include <Swiften/MIX/MIX.h>
Expand All @@ -27,8 +29,6 @@
#include <Swiften/Network/TimerFactory.h>
#include <Swiften/Queries/GenericRequest.h>

#include <Swiften/Base/Log.h>

using namespace Swift;
using namespace std;

Expand Down Expand Up @@ -73,7 +73,7 @@ static void handleChannelLeft(const JID& jid) {
}

static void handleRosterPopulated() {
XMPPRoster* xmppRoster = client->getRoster();
auto xmppRoster = client->getRoster();
int channelCount = 0;
std::cout << "Already Joined channels: " << std::endl;
for (auto item : xmppRoster->getItems()) {
Expand Down Expand Up @@ -110,7 +110,7 @@ static void handleChannelNodesSupported(std::shared_ptr<DiscoItems> items, Error
mixRegistry_->onChannelJoinFailed.connect(&handleChannelJoinFailed);
mixRegistry_->onChannelLeft.connect(&handleChannelLeft);

XMPPRoster* xmppRoster = client->getRoster();
auto xmppRoster = client->getRoster();
xmppRoster->onInitialRosterPopulated.connect(&handleRosterPopulated);
client->requestRoster(true);
}
Expand Down Expand Up @@ -185,10 +185,10 @@ int main(int argc, char* argv[]) {
std::cout << "Connecting..." << std::flush;
client->connect(options);
{
Timer::ref timer = networkFactories.getTimerFactory()->createTimer(30000);
auto timer = networkFactories.getTimerFactory()->createTimer(30000);
timer->onTick.connect(boost::bind(&SimpleEventLoop::stop, &eventLoop));

Timer::ref disconnectTimer = networkFactories.getTimerFactory()->createTimer(25000);
auto disconnectTimer = networkFactories.getTimerFactory()->createTimer(25000);
disconnectTimer->onTick.connect(boost::bind(&Client::disconnect, client.get()));

timer->start();
Expand Down
11 changes: 6 additions & 5 deletions Swiften/MIX/MIXRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
#pragma once

#include <memory>
#include <string>
#include <unordered_set>

#include <boost/signals2.hpp>

#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
#include <Swiften/MIX/MIXImpl.h>
#include <Swiften/Elements/ErrorPayload.h>
#include <Swiften/Elements/MIXJoin.h>
#include <Swiften/Elements/MIXLeave.h>
#include <Swiften/Elements/ErrorPayload.h>
#include <Swiften/Roster/XMPPRoster.h>
#include <Swiften/Queries/IQRouter.h>
#include <Swiften/JID/JID.h>
#include <Swiften/MIX/MIXImpl.h>
#include <Swiften/Queries/GenericRequest.h>
#include <Swiften/Queries/IQRouter.h>
#include <Swiften/Roster/XMPPRoster.h>

namespace Swift {

Expand Down