Skip to content

Commit

Permalink
Rename functions.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila <hello@camila.codes>
  • Loading branch information
Camila committed Mar 25, 2022
1 parent 19660bd commit 7314c82
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gui/tray/TalkReplyTextField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Item {
target: activityModel
function onMessageSent() {
replyMessageTextField.clear();
replyMessageSent.text = activityModel.talkReplyMessageSent(model.index);
replyMessageSent.text = activityModel.replyMessageSent(model.index);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/tray/activitylistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,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();
Expand All @@ -839,7 +839,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();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/tray/activitylistmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class ActivityListModel : public QAbstractListModel

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();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down

0 comments on commit 7314c82

Please sign in to comment.