aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-02-23 10:43:25 +0100
committerGitHub <noreply@github.com>2021-02-23 10:43:25 +0100
commit382b08fc5ad9f22dacb2e6504869c42062565e7c (patch)
treec5b6024be25f1057b045cdb48f275efab91ac352 /lib
parentec60e76d585813ea54a22b58d6fabc52f113e4b1 (diff)
parent1f92a5a957f7de38ef7c2bf425b8d6ac7fa1239c (diff)
downloadlibquotient-382b08fc5ad9f22dacb2e6504869c42062565e7c.tar.gz
libquotient-382b08fc5ad9f22dacb2e6504869c42062565e7c.zip
Merge pull request #455 from arawaaa/removeavatar
Adds ability remove the avatar
Diffstat (limited to 'lib')
-rw-r--r--lib/user.cpp5
-rw-r--r--lib/user.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/user.cpp b/lib/user.cpp
index 9f0386f4..c4c4fec8 100644
--- a/lib/user.cpp
+++ b/lib/user.cpp
@@ -154,6 +154,11 @@ bool User::setAvatar(QIODevice* source)
return doSetAvatar(source);
}
+void User::removeAvatar()
+{
+ connection()->callApi<SetAvatarUrlJob>(id(), "");
+}
+
void User::requestDirectChat() { connection()->requestDirectChat(this); }
void User::ignore() { connection()->addToIgnoredUsers(this); }
diff --git a/lib/user.h b/lib/user.h
index f831865e..d0926189 100644
--- a/lib/user.h
+++ b/lib/user.h
@@ -117,6 +117,8 @@ public Q_SLOTS:
bool setAvatar(const QString& fileName);
/// Upload contents of the QIODevice and set that as an avatar
bool setAvatar(QIODevice* source);
+ /// Removes the avatar from the profile
+ void removeAvatar();
/// Create or find a direct chat with this user
/*! The resulting chat is returned asynchronously via
* Connection::directChatAvailable()