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) {
|
||||
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
|
||||
auto ptr = _chatWidget->getChannel();
|
||||
Channel *c = ptr.get();
|
||||
auto c = _chatWidget->getChannel();
|
||||
if (c == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (c != nullptr) {
|
||||
IrcManager::getInstance().send("PRIVMSG #" + c->getName() + ": " +
|
||||
_edit.toPlainText());
|
||||
c->sendMessage(_edit.toPlainText());
|
||||
event->accept();
|
||||
_edit.setText(QString());
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// completer->setCompletionPrefix("asdf");
|
||||
// completer->complete();
|
||||
|
|
Loading…
Reference in a new issue