mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
Ensured messages are sent to the group chat rather than to individual
users.
This commit is contained in:
parent
86643803cf
commit
acb2793053
2 changed files with 11 additions and 7 deletions
|
@ -45,7 +45,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="src/ui/ChatWindow.cpp" line="100"/>
|
||||
<location filename="src/ui/ChatWindow.cpp" line="104"/>
|
||||
<source>day</source>
|
||||
<translation>
|
||||
<numerusform>%n day</numerusform>
|
||||
|
@ -53,7 +53,7 @@
|
|||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="src/ui/ChatWindow.cpp" line="100"/>
|
||||
<location filename="src/ui/ChatWindow.cpp" line="104"/>
|
||||
<source>hour</source>
|
||||
<translation>
|
||||
<numerusform>%n hour</numerusform>
|
||||
|
@ -61,7 +61,7 @@
|
|||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="src/ui/ChatWindow.cpp" line="100"/>
|
||||
<location filename="src/ui/ChatWindow.cpp" line="104"/>
|
||||
<source>minute</source>
|
||||
<translation>
|
||||
<numerusform>%n minute</numerusform>
|
||||
|
@ -76,7 +76,7 @@
|
|||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/ui/ChatWindow.cpp" line="150"/>
|
||||
<location filename="src/ui/ChatWindow.cpp" line="154"/>
|
||||
<source>%1 online now:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -78,10 +78,14 @@ bool ChatWindow::eventFilter(QObject* sender, QEvent* event) {
|
|||
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if ((keyEvent->key() == Qt::Key_Return || keyEvent->key() == Qt::Key_Enter) &&
|
||||
(keyEvent->modifiers() & Qt::ShiftModifier) == 0) {
|
||||
QString message = ui->messagePlainTextEdit->document()->toPlainText();
|
||||
if (!message.trimmed().isEmpty()) {
|
||||
QString messageText = ui->messagePlainTextEdit->document()->toPlainText().trimmed();
|
||||
if (!messageText.isEmpty()) {
|
||||
const QXmppMucRoom* publicChatRoom = XmppClient::getInstance().getPublicChatRoom();
|
||||
XmppClient::getInstance().getXMPPClient().sendMessage(publicChatRoom->jid(), message);
|
||||
QXmppMessage message;
|
||||
message.setTo(publicChatRoom->jid());
|
||||
message.setType(QXmppMessage::GroupChat);
|
||||
message.setBody(messageText);
|
||||
XmppClient::getInstance().getXMPPClient().sendPacket(message);
|
||||
ui->messagePlainTextEdit->document()->clear();
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue