moment/src/qml/Models/Users.qml

27 lines
686 B
QML
Raw Normal View History

2019-07-07 23:52:41 -04:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
2019-07-04 16:01:44 -04:00
import SortFilterProxyModel 0.2
import "../Base"
HListModel {
function find(userId) {
2019-07-07 22:36:12 -04:00
// Happens when SortFilterProxyModel ExpressionFilter/Sorter/Role tests
// the expression with invalid data to establish property bindings
if (! userId) { return }
2019-07-07 22:36:12 -04:00
var found = getWhere({userId}, 1)
2019-07-04 16:01:44 -04:00
if (found.length > 0) { return found[0] }
py.callCoro("request_user_update_event", [userId])
return {
userId,
displayName: "",
avatarUrl: "",
statusMessage: "",
}
2019-07-04 16:01:44 -04:00
}
}