2015-11-30 23:42:37 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <boost/noncopyable.hpp>
|
|
|
|
#include <log4cpp/Category.hh>
|
|
|
|
|
2017-05-24 22:38:45 +02:00
|
|
|
#include <vector>
|
2015-11-30 23:42:37 +01:00
|
|
|
#include <string>
|
|
|
|
#include <boost/regex.hpp>
|
|
|
|
#include "MumbleCommunicator.hpp"
|
|
|
|
|
|
|
|
namespace mumble {
|
|
|
|
class MumbleChannelJoiner : boost::noncopyable {
|
2017-05-24 22:38:45 +02:00
|
|
|
|
|
|
|
struct ChannelEntry {
|
|
|
|
int id;
|
|
|
|
std::string name;
|
|
|
|
};
|
|
|
|
|
2015-11-30 23:42:37 +01:00
|
|
|
public:
|
|
|
|
MumbleChannelJoiner(std::string channelNameRegex);
|
|
|
|
|
|
|
|
void checkChannel(std::string channel_name, int channel_id);
|
|
|
|
void maybeJoinChannel(mumble::MumbleCommunicator *mc);
|
2017-05-24 22:38:45 +02:00
|
|
|
void findJoinChannel(mumble::MumbleCommunicator *mc);
|
2017-05-27 22:12:26 +02:00
|
|
|
void joinOtherChannel(mumble::MumbleCommunicator *mc, std::string channelNameRegex);
|
2015-11-30 23:42:37 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
log4cpp::Category &logger;
|
|
|
|
boost::regex channelNameRegex;
|
|
|
|
int channel_id;
|
2017-05-24 22:38:45 +02:00
|
|
|
static std::vector<ChannelEntry> channels;
|
2015-11-30 23:42:37 +01:00
|
|
|
};
|
|
|
|
}
|