Open ehrenberg opened 8 years ago
My solution:
DemoServerAdapter.prototype.getUserList = function(roomId, conversationId, done) {
console.log("DemoServerAdapter: getUserList");
var tmpUsers = new Array();
$.ajax({
url : "/plugins/messages/ajax.php",
type : "POST",
dataType: 'json',
data : {type : "get_userlist"},
context:this,
success : function(data) {
var $t = new Array();
$.each(data, function(index) {
console.log(index);
var tmpUser = new ChatUserInfo();
tmpUser.Id = data[index].ID;
tmpUser.RoomId = 1;
tmpUser.Name = data[index].FirstName+' '+data[index].LastName;
tmpUser.Email = data[index].Email;
tmpUser.ProfilePictureUrl = "";
tmpUser.Status = data[index].Online;
tmpUsers[index] = tmpUser;
});
this.users = tmpUsers;
if (roomId == DemoAdapterConstants.DEFAULT_ROOM_ID) {
done(this.users);
return;
}
throw "The given room or conversation is not supported by the demo adapter";
}
});
};
Hi everyone,
I've tried to fill my Userlist with Ajax in my own Adapter. But no users shown. The Array is filled. I'am confused. Maybe some help? Thanks alot!