Software /
code /
prosody
Comparison
plugins/mod_scansion_record.lua @ 9354:b042aa047d80
mod_scansion_record: Correctly retrieve resource
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 22 Sep 2018 14:07:49 +0200 |
parent | 9353:02ae04efab0f |
child | 9355:a31e0d549b74 |
comparison
equal
deleted
inserted
replaced
9353:02ae04efab0f | 9354:b042aa047d80 |
---|---|
40 devices = {}; | 40 devices = {}; |
41 n_devices = 0; | 41 n_devices = 0; |
42 }; | 42 }; |
43 end | 43 end |
44 local user = users[session.username]; | 44 local user = users[session.username]; |
45 local device = user.devices[event.resource]; | 45 local device = user.devices[session.resource]; |
46 if not device then | 46 if not device then |
47 user.n_devices = user.n_devices + 1; | 47 user.n_devices = user.n_devices + 1; |
48 device = devices[user.n_devices] or ("device"..id.short()); | 48 device = devices[user.n_devices] or ("device"..id.short()); |
49 user.devices[event.resource] = device; | 49 user.devices[session.resource] = device; |
50 end | 50 end |
51 session.scansion_character = user.character; | 51 session.scansion_character = user.character; |
52 session.scansion_device = device; | 52 session.scansion_device = device; |
53 session.scansion_id = user.character..(device ~= "" and "'s "..device or device); | 53 session.scansion_id = user.character..(device ~= "" and "'s "..device or device); |
54 | 54 |