 	# sane functions. This is the actual API
 	# any function who differs in name from the ttfm ones have a copy that calls said ttfm function
 	# this is for API compatibility between ttapi and plugapi
-	joinRoom: (name, callback)->
-		@sendRPC('room.join', [name], callback)
+	joinRoom: (name, callback)=>
+		@sendRPC 'room.join', [name], (data)=>
+			for user in data['room']['users']
+				@room.addUser user
+			callback.apply @, arguments
 
 	# alias for ttapi compatibility
 	roomRegister: (name, callback)->

		if (!key)
			throw new Error("You must pass the authentication cookie into the PlugAPI object to connect correctly")
		@rpcHandlers = {}

	setLogObject: (c)->
		logger = c

http = require('http')
EventEmitter = require('events').EventEmitter
Encoder = require('node-html-encoder').Encoder

# track state of room internally
Room = require('./room')

# create our entity encoder for decoding chat messages
encoder = new Encoder('entity')
