* change dotted last read message indicator to a line, remove
airbrushgrenade

* sort emotes in tab completion

* implement tabbing usernames

* FeelsOkayMan

* fix emotes and usernames comparing; formatting

* remove private/personal stuff

* change lastmessageindicator back to default verpattern
This commit is contained in:
hemirt
2018-03-24 11:12:24 +01:00
committed by pajlada
parent 0423702e50
commit ab42a30108
4 changed files with 78 additions and 10 deletions
+15
View File
@@ -8,6 +8,7 @@
#include "widgets/notebook.hpp"
#include "widgets/split.hpp"
#include "widgets/splitcontainer.hpp"
#include "util/urlfetch.hpp"
#include <QCompleter>
#include <QPainter>
@@ -24,6 +25,20 @@ SplitInput::SplitInput(Split *_chatWidget)
// auto completion
auto completer = new QCompleter(
singletons::CompletionManager::getInstance().createModel(this->chatWidget->channelName));
auto cc = singletons::CompletionManager::getInstance().createModel(this->chatWidget->channelName);
cc->refresh();
static QStringList jsonLabels = {"moderators", "staff", "admins", "global_mods", "viewers"};
util::twitch::get("https://tmi.twitch.tv/group/user/" + this->chatWidget->channelName + "/chatters", this,
[cc](QJsonObject obj) {
QJsonObject chattersObj = obj.value("chatters").toObject();
for (int i = 0; i < jsonLabels.size(); i++) {
foreach (const QJsonValue &v,
chattersObj.value(jsonLabels.at(i)).toArray())
cc->addUser(v.toString());
}
});
this->ui.textEdit->setCompleter(completer);