Well you can use this but it is not going to do what you are talking about.
WhoWhere - lists all of the users in all rooms; with one room per line, formatted as: roomID: roomName: userList.
Insert this code at the end of the plugin.
PHP Code:
$apichat['current_users'] = getAPI("WhoWhere");
That will get you the list of users and the room. What you are talking about would take some changes in how the API Chat works or some trial and error with PHP.