2019-07-05 06:01:44 +10:00
|
|
|
import QtQuick 2.7
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
import "../Base"
|
|
|
|
|
|
|
|
HListModel {
|
2019-07-08 12:41:32 +10:00
|
|
|
function find(user_id) {
|
2019-07-08 12:36:12 +10:00
|
|
|
// Happens when SortFilterProxyModel ExpressionFilter/Sorter/Role tests
|
|
|
|
// the expression with invalid data to establish property bindings
|
|
|
|
if (! user_id) { return }
|
|
|
|
|
2019-07-05 06:01:44 +10:00
|
|
|
var found = getWhere({"userId": user_id}, 1)
|
|
|
|
if (found.length > 0) { return found[0] }
|
|
|
|
|
2019-07-07 15:37:13 +10:00
|
|
|
py.callCoro("request_user_update_event", [user_id])
|
|
|
|
|
|
|
|
return {
|
2019-07-05 06:01:44 +10:00
|
|
|
"userId": user_id,
|
|
|
|
"displayName": "",
|
|
|
|
"avatarUrl": "",
|
|
|
|
"statusMessage": ""
|
2019-07-07 15:37:13 +10:00
|
|
|
}
|
2019-07-05 06:01:44 +10:00
|
|
|
}
|
|
|
|
}
|