1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor: Rename signal and remove unused params

This commit is contained in:
Diadlo 2017-11-24 12:59:47 +03:00
parent 7c76bebebe
commit 9ac5f881c6
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
5 changed files with 8 additions and 12 deletions

View File

@ -677,10 +677,9 @@ void Core::sendGroupMessageWithType(int groupId, const QString& message, TOX_MES
TOX_ERR_CONFERENCE_SEND_MESSAGE error;
bool ok = tox_conference_send_message(tox, groupId, type, cMsg.data(), cMsg.size(), &error);
if (!ok || !parseConferenceSendMessageError(error)) {
emit groupSentResult(groupId, message, -1);
emit groupSentFailed(groupId);
return;
}
}
}

View File

@ -156,7 +156,7 @@ signals:
void idSet(const ToxId& id);
void messageSentResult(uint32_t friendId, const QString& message, int messageId);
void groupSentResult(int groupId, const QString& message, int result);
void groupSentFailed(int groupId);
void actionSentResult(uint32_t friendId, const QString& action, int success);
void receiptRecieved(int friedId, int receipt);

View File

@ -228,7 +228,7 @@ void Nexus::showMainGUI()
connect(core, &Core::emptyGroupCreated, widget, &Widget::onEmptyGroupCreated);
connect(core, &Core::friendTypingChanged, widget, &Widget::onFriendTypingChanged);
connect(core, &Core::messageSentResult, widget, &Widget::onMessageSendResult);
connect(core, &Core::groupSentResult, widget, &Widget::onGroupSendResult);
connect(core, &Core::groupSentFailed, widget, &Widget::onGroupSendFailed);
connect(widget, &Widget::statusSet, core, &Core::setStatus);
connect(widget, &Widget::friendRequested, core, &Core::requestFriendship);

View File

@ -2040,19 +2040,16 @@ void Widget::onMessageSendResult(uint32_t friendId, const QString& message, int
}
}
void Widget::onGroupSendResult(int groupId, const QString& message, int result)
void Widget::onGroupSendFailed(int groupId)
{
Q_UNUSED(message)
Group* g = GroupList::findGroup(groupId);
if (!g) {
return;
}
if (result == -1) {
QString message = tr("Message failed to send");
QDateTime curTime = QDateTime::currentDateTime();
g->getChatForm()->addSystemInfoMessage(message, ChatMessage::INFO, curTime);
}
QString message = tr("Message failed to send");
QDateTime curTime = QDateTime::currentDateTime();
g->getChatForm()->addSystemInfoMessage(message, ChatMessage::INFO, curTime);
}
void Widget::onFriendTypingChanged(int friendId, bool isTyping)

View File

@ -170,7 +170,7 @@ public slots:
void onGroupNamelistChanged(int groupnumber, int peernumber, uint8_t change);
void onGroupTitleChanged(int groupnumber, const QString& author, const QString& title);
void onGroupPeerAudioPlaying(int groupnumber, int peernumber);
void onGroupSendResult(int groupId, const QString& message, int result);
void onGroupSendFailed(int groupId);
void onFriendTypingChanged(int friendId, bool isTyping);
void nextContact();
void previousContact();