Use eventables in matrix.client, implement a chunk of functionality

Yeah, I know: commits should have been smaller and all that. Yadda-yadda.
This commit is contained in:
Adrian Perez de Castro
2016-07-01 05:05:50 +03:00
parent fc99710658
commit e128366f7f
3 changed files with 269 additions and 58 deletions

View File

@@ -16,7 +16,11 @@ client:login_with_password(arg[2], arg[3])
local user = client:get_user()
print("User ID: " .. user.user_id)
print("Display name: " .. user:get_display_name())
print("Avatar URL: " .. user:get_avatar_url())
user:hook("property-changed", function (user, property)
print(" - " .. property .. ": " .. tostring(user[property]))
end)
user:update_display_name()
user:update_avatar_url()
client:logout()