aboutsummaryrefslogtreecommitdiffstats
path: root/libmatrix.c
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2016-12-31 21:13:34 +1100
committerDamien Zammit <damien@zamaudio.com>2017-01-05 21:53:21 +1100
commit2c17db466d7631eee7bcf4e7505b03115ce901e3 (patch)
tree106f9f8bb646c775742a3a76a2276699214cc910 /libmatrix.c
parent61ffd59e2e658daec87f79a8d05a9d202d76e9a3 (diff)
downloadpurple-matrix-2c17db466d7631eee7bcf4e7505b03115ce901e3.tar.gz
Enable room invites when matrix handle is known
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Diffstat (limited to 'libmatrix.c')
-rw-r--r--libmatrix.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libmatrix.c b/libmatrix.c
index 37e7450..5b3118c 100644
--- a/libmatrix.c
+++ b/libmatrix.c
@@ -36,6 +36,7 @@
#include "matrix-connection.h"
#include "matrix-room.h"
+#include "matrix-api.h"
/**
* Called to get the icon name for the given buddy and account.
@@ -178,7 +179,15 @@ static void matrixprpl_reject_chat(PurpleConnection *gc, GHashTable *components)
matrix_connection_reject_invite(gc, room_id);
}
+static void matrixprpl_chat_invite(PurpleConnection *gc, int id,
+ const char *message, const char *who)
+{
+ PurpleConversation *conv = purple_find_chat(gc, id);
+ MatrixConnectionData *conn;
+ conn = (MatrixConnectionData *)(conv->account->gc->proto_data);
+ matrix_api_invite_user(conn, conv->name, who, NULL, NULL, NULL, NULL);
+}
/**
* handle leaving a chat: notify the server that we are leaving, and
@@ -279,7 +288,7 @@ static PurplePluginProtocolInfo prpl_info =
matrixprpl_join_chat, /* join_chat */
matrixprpl_reject_chat, /* reject_chat */
matrixprpl_get_chat_name, /* get_chat_name */
- NULL, /* chat_invite */
+ matrixprpl_chat_invite, /* chat_invite */
matrixprpl_chat_leave, /* chat_leave */
NULL, /* chat_whisper */
matrixprpl_chat_send, /* chat_send */