about summary refs log tree commit diff stats
path: root/src/xmpp/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/message.c')
-rw-r--r--src/xmpp/message.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index e6927f76..1bb3bcdc 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -204,7 +204,16 @@ message_send_invite(const char * const roomjid, const char * const contact,
 {
     xmpp_conn_t * const conn = connection_get_conn();
     xmpp_ctx_t * const ctx = connection_get_ctx();
-    xmpp_stanza_t *stanza = stanza_create_invite(ctx, roomjid, contact, reason);
+    xmpp_stanza_t *stanza;
+
+    muc_member_type_t member_type = muc_member_type(roomjid);
+    if (member_type == MUC_MEMBER_TYPE_PUBLIC) {
+        log_debug("Sending direct invite to %s, for %s", contact, roomjid);
+        stanza = stanza_create_invite(ctx, roomjid, contact, reason);
+    } else {
+        log_debug("Sending mediated invite to %s, for %s", contact, roomjid);
+        stanza = stanza_create_mediated_invite(ctx, roomjid, contact, reason);
+    }
 
     xmpp_send(conn, stanza);
     xmpp_stanza_release(stanza);