Commit fc467b58 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Sébastien Blin

conversations: user search

Change-Id: Icc41b09d1ef72fb579f47f39b028280a58591906
parent 5f05f877
......@@ -75,6 +75,7 @@ public:
* @throws out_of_range exception if can't find the contact
*/
const contact::Info getContact(const QString& contactUri) const;
ContactInfoMap getSearchResults() const;
/**
* get list of banned contacts.
* @return list of banned contacts uris as string
......
......@@ -122,6 +122,26 @@ public:
* @return a copy of the conversation
*/
Q_INVOKABLE conversation::Info filteredConversation(unsigned int row) const;
/**
* Get the search results
* @return a searchResult
*/
const ConversationQueue& getAllSearchResults() const;
/**
* Get the conversation at row in the search results
* @param row
* @return a copy of the conversation
*/
conversation::Info searchResultForRow(unsigned int row) const;
/**
* Update the searchResults
* @param new status
*/
void updateSearchStatus(const QString& status) const;
/**
* Emit a filterChanged signal to force the client to refresh the filter. For instance
* this is required when a contact was banned or un-banned.
......@@ -324,6 +344,16 @@ Q_SIGNALS:
void displayedInteractionChanged(const QString& uid, const QString& participantURI,
const uint64_t previousUid, const uint64_t newdUid) const;
/**
* Emitted when search status changed
* @param status
*/
void searchStatusChanged(const QString& status) const;
/**
* Emitted when search result has been updated
*/
void searchResultUpdated() const;
private:
std::unique_ptr<ConversationModelPimpl> pimpl_;
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -184,6 +184,10 @@ public:
[this](const std::string& account_id, const std::string& from, int status) {
Q_EMIT this->composingStatusChanged(QString(account_id.c_str()), QString(from.c_str()), status > 0 ? true : false);
}),
exportable_callback<ConfigurationSignal::UserSearchEnded>(
[this](const std::string& account_id, int status, const std::string& query, const std::vector<std::map<std::string, std::string>>& results) {
Q_EMIT this->userSearchEnded(QString(account_id.c_str()), status, QString(query.c_str()), convertVecMap(results));
}),
};
dataXferHandlers = {
......@@ -725,6 +729,10 @@ public Q_SLOTS: // METHODS
return DRing::setMessageDisplayed(accountId.toStdString(), contactId.toStdString(), messageId.toStdString(), status);
}
bool searchUser(const QString& accountId, const QString& query) {
return DRing::searchUser(accountId.toStdString(), query.toStdString());
}
Q_SIGNALS: // SIGNALS
void volumeChanged(const QString& device, double value);
void accountsChanged();
......@@ -758,6 +766,7 @@ Q_SIGNALS: // SIGNALS
void accountProfileReceived(const QString& accountId, const QString& displayName, const QString& userPhoto);
void debugMessageReceived(const QString& message);
void composingStatusChanged(const QString& accountId, const QString& contactId, bool isComposing);
void userSearchEnded(const QString& accountId, int status, const QString& query, VectorMapStringString results);
};
namespace org { namespace ring { namespace Ring {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment