2017-06-11 09:31:45 +02:00
|
|
|
#include "channel.hpp"
|
2017-11-04 14:57:29 +01:00
|
|
|
#include "debug/log.hpp"
|
2017-06-11 09:31:45 +02:00
|
|
|
#include "emotemanager.hpp"
|
|
|
|
#include "ircmanager.hpp"
|
|
|
|
#include "logging/loggingmanager.hpp"
|
|
|
|
#include "messages/message.hpp"
|
|
|
|
#include "windowmanager.hpp"
|
2017-01-01 13:07:36 +01:00
|
|
|
|
2017-01-26 17:48:14 +01:00
|
|
|
#include <QJsonArray>
|
|
|
|
#include <QJsonDocument>
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QJsonValue>
|
|
|
|
#include <QNetworkAccessManager>
|
|
|
|
#include <QNetworkReply>
|
|
|
|
#include <QNetworkRequest>
|
2017-03-11 11:39:59 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
using namespace chatterino::messages;
|
2017-04-12 17:46:44 +02:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2017-11-04 14:57:29 +01:00
|
|
|
Channel::Channel(const QString &_name)
|
|
|
|
: name(_name)
|
2017-09-21 12:15:01 +02:00
|
|
|
// , loggingChannel(logging::get(name))
|
2017-01-01 13:07:36 +01:00
|
|
|
{
|
2017-01-07 20:43:55 +01:00
|
|
|
}
|
2017-01-05 16:07:20 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
bool Channel::isEmpty() const
|
|
|
|
{
|
2017-09-16 00:05:06 +02:00
|
|
|
return false;
|
2017-01-26 17:26:20 +01:00
|
|
|
}
|
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
messages::LimitedQueueSnapshot<messages::SharedMessage> Channel::getMessageSnapshot()
|
2017-01-26 17:26:20 +01:00
|
|
|
{
|
2017-09-21 12:15:01 +02:00
|
|
|
return this->messages.getSnapshot();
|
2017-04-12 17:46:44 +02:00
|
|
|
}
|
2017-01-26 17:26:20 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
void Channel::addMessage(std::shared_ptr<Message> message)
|
|
|
|
{
|
|
|
|
std::shared_ptr<Message> deleted;
|
2017-01-26 17:26:20 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
// if (_loggingChannel.get() != nullptr) {
|
|
|
|
// _loggingChannel->append(message);
|
|
|
|
// }
|
2017-01-26 17:26:20 +01:00
|
|
|
|
2017-09-21 12:15:01 +02:00
|
|
|
if (this->messages.appendItem(message, deleted)) {
|
2017-04-12 17:46:44 +02:00
|
|
|
messageRemovedFromStart(deleted);
|
|
|
|
}
|
2017-01-26 17:26:20 +01:00
|
|
|
|
2017-04-12 17:46:44 +02:00
|
|
|
this->messageAppended(message);
|
|
|
|
}
|
2017-01-26 17:26:20 +01:00
|
|
|
|
2017-09-16 00:05:06 +02:00
|
|
|
bool Channel::canSendMessage() const
|
2017-04-12 17:46:44 +02:00
|
|
|
{
|
2017-09-16 00:05:06 +02:00
|
|
|
return false;
|
2017-04-12 17:46:44 +02:00
|
|
|
}
|
2017-01-26 17:26:20 +01:00
|
|
|
|
2017-05-27 17:45:40 +02:00
|
|
|
void Channel::sendMessage(const QString &message)
|
|
|
|
{
|
2017-01-05 16:07:20 +01:00
|
|
|
}
|
2017-03-11 11:32:19 +01:00
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
} // namespace chatterino
|