Merge 1.5.0 changes back to master.

This commit is contained in:
James Muehlner 2022-11-29 03:46:57 +00:00
commit add7ce361b

View File

@ -303,14 +303,14 @@ int guac_client_add_user(guac_client* client, guac_user* user, int argc, char**
if (user->owner) if (user->owner)
client->__owner = user; client->__owner = user;
/* Notify owner of user joining connection. */
else
guac_client_owner_notify_join(client, user);
} }
pthread_rwlock_unlock(&(client->__users_lock)); pthread_rwlock_unlock(&(client->__users_lock));
/* Notify owner of user joining connection. */
if (retval == 0 && !user->owner)
guac_client_owner_notify_join(client, user);
return retval; return retval;
} }
@ -335,12 +335,12 @@ void guac_client_remove_user(guac_client* client, guac_user* user) {
if (user->owner) if (user->owner)
client->__owner = NULL; client->__owner = NULL;
/* Update owner of user having left the connection. */
else
guac_client_owner_notify_leave(client, user);
pthread_rwlock_unlock(&(client->__users_lock)); pthread_rwlock_unlock(&(client->__users_lock));
/* Update owner of user having left the connection. */
if (!user->owner)
guac_client_owner_notify_leave(client, user);
/* Call handler, if defined */ /* Call handler, if defined */
if (user->leave_handler) if (user->leave_handler)
user->leave_handler(user); user->leave_handler(user);