summaryrefslogtreecommitdiffstats
blob: 74d95ef49b0a1d683e1725c8af882166ff8bc8b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "Slimber/Cocoa/Slimber.h"

#include "Swiften/LinkLocal/AppleDNSSDService.h"
#include "Slimber/Cocoa/Menulet.h"
#include "Slimber/Server.h"

using namespace Swift;

Slimber::Slimber() {
	dnsSDService = boost::shared_ptr<AppleDNSSDService>(new AppleDNSSDService());
	server = new Server(5222, 5562, dnsSDService);
	server->onSelfConnected.connect(boost::bind(&Slimber::handleSelfConnected, this, _1));
	menulet = [[Menulet alloc] init];
}

Slimber::~Slimber() {
	delete server;
	[menulet release];
}

void Slimber::handleSelfConnected(bool b) {
	[menulet setSelfConnected: b];
}