aboutsummaryrefslogtreecommitdiff
path: root/lib/user.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-01 22:48:38 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-04 09:07:32 +0900
commitf1ffe1e7a3e81c07a07a8416ce307e4413ec8fbc (patch)
treef2435183d11a4cea52a7532eb9ff3d4d837e1d22 /lib/user.h
parentd5397fe5ae2ca34d5cfb11394dac17728a2b50ce (diff)
downloadlibquotient-f1ffe1e7a3e81c07a07a8416ce307e4413ec8fbc.tar.gz
libquotient-f1ffe1e7a3e81c07a07a8416ce307e4413ec8fbc.zip
Event types system remade to be extensible
There were two common points that had to be updated every time a new event is introduced: the EventType enumeration and one of 3 doMakeEvent<> specialisations. The new code has a template class, EventFactory<>, that uses a list of static factory methods to create events instead of typelists used in doMakeEvent<>(); the EventType enumeration is replaced with a namespace populated with constants as necessary. In general, EventType is considered a deprecated mechanism altogether; instead, a set of facilities is provided: is<>() to check if an event has a certain type (to replace comparison against an EventType value) and visit<>() to execute actions based on the event type (replacing switch statements over EventType values). Closes #129.
Diffstat (limited to 'lib/user.h')
-rw-r--r--lib/user.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/user.h b/lib/user.h
index 76aa672f..1cf72155 100644
--- a/lib/user.h
+++ b/lib/user.h
@@ -106,10 +106,18 @@ namespace QMatrixClient
void processEvent(const RoomMemberEvent& event, const Room* r);
public slots:
+ /** Set a new name in the global user profile */
void rename(const QString& newName);
+ /** Set a new name for the user in one room */
void rename(const QString& newName, const Room* r);
+ /** Upload the file and use it as an avatar */
bool setAvatar(const QString& fileName);
+ /** Upload contents of the QIODevice and set that as an avatar */
bool setAvatar(QIODevice* source);
+ /** Create or find a direct chat with this user
+ * The resulting chat is returned asynchronously via
+ * Connection::directChatAvailable()
+ */
void requestDirectChat();
signals: