mike-jumper commented on code in PR #791:
URL: https://github.com/apache/guacamole-client/pull/791#discussion_r1092457976
##########
guacamole-common-js/src/main/webapp/modules/Client.js:
##########
@@ -1416,8 +1450,31 @@ Guacamole.Client = function(tunnel) {
},
"msg" : function(parameters) {
-
- if (guac_client.onmsg) guac_client.onmsg(parseInt(parameters[0]),
parameters.slice(1));
+
+ var userID;
+ var username;
+
+ var msgid = parseInt(parameters[0]);
+ if (guac_client.onmsg)
+ guac_client.onmsg(msgid, parameters.slice(1));
+
+ switch (msgid) {
+
+ case Guacamole.Client.Message.USER_JOINED:
+ userID = parameters[1];
+ username = parameters[2];
+ if (guac_client.onjoin)
+ guac_client.onjoin(userID, username);
+ break;
+
+ case Guacamole.Client.Message.USER_LEFT:
+ userID = parameters[1];
+ username = parameters[2];
+ if (guac_client.onleave)
+ guac_client.onleave(userID, username);
+ break;
+
+ }
Review Comment:
Ah, gotcha. Nope - definitely on purpose. I wanted to provide an optional,
more convenient way of handling these messages that doesn't require as much
low-level familiarity with the Guacamole protocol.
--
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]