Rename functions.

Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
Camila 2022-03-25 20:02:42 +01:00
parent a46482ca91
commit 9b00e5268e
No known key found for this signature in database
GPG key ID: 7A4A6121E88E2AD4
4 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@ Item {
target: activityModel
function onMessageSent() {
replyMessageTextField.clear();
replyMessageSent.text = activityModel.talkReplyMessageSent(model.index);
replyMessageSent.text = activityModel.replyMessageSent(model.index);
}
}

View file

@ -817,7 +817,7 @@ void ActivityListModel::slotRemoveAccount()
_showMoreActivitiesAvailableEntry = false;
}
void ActivityListModel::replyMessageSent(const int activityIndex, const QString &message)
void ActivityListModel::setReplyMessageSent(const int activityIndex, const QString &message)
{
if (activityIndex < 0 || activityIndex >= _finalList.size()) {
qCWarning(lcActivity) << "Couldn't trigger action on activity at index" << activityIndex << "/ final list size:" << _finalList.size();
@ -829,7 +829,7 @@ void ActivityListModel::replyMessageSent(const int activityIndex, const QString
emit messageSent();
}
QString ActivityListModel::talkReplyMessageSent(const int activityIndex) const
QString ActivityListModel::replyMessageSent(const int activityIndex) const
{
if (activityIndex < 0 || activityIndex >= _finalList.size()) {
qCWarning(lcActivity) << "Couldn't trigger action on activity at index" << activityIndex << "/ final list size:" << _finalList.size();

View file

@ -106,8 +106,8 @@ public:
void setCurrentItem(const int currentItem);
void replyMessageSent(const int activityIndex, const QString &message);
Q_INVOKABLE QString talkReplyMessageSent(const int activityIndex) const;
void setReplyMessageSent(const int activityIndex, const QString &message);
Q_INVOKABLE QString replyMessageSent(const int activityIndex) const;
public slots:
void slotRefreshActivity();

View file

@ -798,7 +798,7 @@ void User::slotSendReplyMessage(const int activityIndex, const QString &token, c
QPointer<TalkReply> talkReply = new TalkReply(_account.data(), this);
talkReply->sendReplyMessage(token, message, replyTo);
connect(talkReply, &TalkReply::replyMessageSent, this, [&](const QString &message) {
_activityModel->replyMessageSent(activityIndex, message);
_activityModel->setReplyMessageSent(activityIndex, message);
});
}