mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix message sending
This commit is contained in:
parent
a9a68add38
commit
5208e0f2fd
|
@ -62,16 +62,15 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *widget)
|
||||||
|
|
||||||
_edit.keyPressed.connect([this/*, completer*/](QKeyEvent *event) {
|
_edit.keyPressed.connect([this/*, completer*/](QKeyEvent *event) {
|
||||||
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
|
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
|
||||||
auto ptr = _chatWidget->getChannel();
|
auto c = _chatWidget->getChannel();
|
||||||
Channel *c = ptr.get();
|
if (c == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (c != nullptr) {
|
c->sendMessage(_edit.toPlainText());
|
||||||
IrcManager::getInstance().send("PRIVMSG #" + c->getName() + ": " +
|
|
||||||
_edit.toPlainText());
|
|
||||||
event->accept();
|
event->accept();
|
||||||
_edit.setText(QString());
|
_edit.setText(QString());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// else {
|
// else {
|
||||||
// completer->setCompletionPrefix("asdf");
|
// completer->setCompletionPrefix("asdf");
|
||||||
// completer->complete();
|
// completer->complete();
|
||||||
|
|
Loading…
Reference in a new issue