mike-jumper commented on code in PR #358:
URL: https://github.com/apache/guacamole-server/pull/358#discussion_r1020454253


##########
src/libguac/client.c:
##########
@@ -701,6 +739,116 @@ int guac_client_owner_supports_required(guac_client* 
client) {
     
 }
 
+/**
+ * A callback function that is invokved by guac_client_owner_notify_join() to
+ * notify the owner of a connection that another user has joined the
+ * connection, returning zero if the message is sent successfully, or non-zero
+ * if an error occurs.
+ *
+ * @param user
+ *     The user to send the notification to, which will be the owner of the
+ *     connection.
+ *
+ * @param data
+ *     The data provided to the callback, which is the user that is joining the
+ *     connection.
+ *
+ * @return
+ *     Zero if the message is sent successfully to the owner, otherwise
+ *     non-zero, cast as a void*.
+ */
+static void* guac_client_owner_notify_join_callback(guac_user* user, void* 
data) {
+
+    const guac_user* joiner = (const guac_user *) data;
+
+    if (user == NULL)
+        return (void*) ((intptr_t) -1);
+
+    char* owner = "owner";
+    if (user->info.name != NULL)
+        owner = (char *) user->info.name;
+
+    char* joinName = "anonymous";
+    if (joiner->info.name != NULL)
+        joinName = (char *) joiner->info.name;
+
+    guac_user_log(user, GUAC_LOG_DEBUG, "Notifying owner \"%s\" of \"%s\" 
joining.", owner, joinName);
+    
+    /* Send required parameters to owner. */
+    const char* args[] = { (const char*)joinName, NULL };

Review Comment:
   Nope - definitely should keep internals internal. My thinking was that 
client implementations may need to reliably differentiate between distinct 
users of a session, such as to provide a list of current users, regardless of 
whether their human-readable names match. Including the UUID would provide the 
necessary information for implementations to do that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to