Fix jdenticons in various places

This commit is contained in:
Loren Burkholder 2021-09-04 20:54:02 -04:00
parent 356723fe06
commit 17729ce662
7 changed files with 23 additions and 10 deletions

View file

@ -61,6 +61,7 @@ ApplicationWindow {
header: AvatarListTile {
title: imagePack.packname
avatarUrl: imagePack.avatarUrl
userid: imagePack.packname
subtitle: imagePack.statekey
index: -1
selectedIndex: currentImageIndex
@ -111,7 +112,6 @@ ApplicationWindow {
title: shortCode
subtitle: body
avatarUrl: url
roomid: imagePack.roomid
selectedIndex: currentImageIndex
crop: false
@ -143,6 +143,7 @@ ApplicationWindow {
Layout.columnSpan: 2
url: imagePack.avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: imagePack.packname
userid: imagePack.packname
height: 130
width: 130
crop: false
@ -220,6 +221,7 @@ ApplicationWindow {
Layout.columnSpan: 2
url: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.Url).replace("mxc://", "image://MxcImage/")
displayName: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.ShortCode)
userid: displayName
height: 130
width: 130
crop: false

View file

@ -112,7 +112,7 @@ ApplicationWindow {
return qsTr("Globally enabled pack");
}
selectedIndex: currentPackIndex
roomid: currentPack.roomid
userid: displayName
TapHandler {
onSingleTapped: currentPackIndex = index
@ -144,6 +144,7 @@ ApplicationWindow {
Avatar {
url: packinfo.avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: packinfo.packName
userid: packinfo.packName
height: 100
width: 100
Layout.alignment: Qt.AlignHCenter

View file

@ -34,15 +34,15 @@ Rectangle {
width: Nheko.avatarSize
height: Nheko.avatarSize
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
displayName: CallManager.callParty
userid: CallManager.callParty
displayName: CallManager.callPartyDisplayName
onClicked: TimelineManager.openImageOverlay(room.avatarUrl(userid), room.data.eventId)
}
Label {
Layout.leftMargin: 8
font.pointSize: fontMetrics.font.pointSize * 1.1
text: CallManager.callParty
text: CallManager.callPartyDisplayName
color: "#000000"
}

View file

@ -40,7 +40,7 @@ Popup {
Label {
Layout.alignment: Qt.AlignCenter
Layout.topMargin: msgView.height / 25
text: CallManager.callParty
text: CallManager.callPartyDisplayName
font.pointSize: fontMetrics.font.pointSize * 2
color: Nheko.colors.windowText
}
@ -50,7 +50,8 @@ Popup {
width: msgView.height / 5
height: msgView.height / 5
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
displayName: CallManager.callParty
userid: CallManager.callParty
displayName: CallManager.callPartyDisplayName
}
ColumnLayout {

View file

@ -41,14 +41,15 @@ Rectangle {
width: Nheko.avatarSize
height: Nheko.avatarSize
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
displayName: CallManager.callParty
userid: CallManager.callParty
displayName: CallManager.callPartyDisplayName
onClicked: TimelineManager.openImageOverlay(room.avatarUrl(userid), room.data.eventId)
}
Label {
Layout.leftMargin: 8
font.pointSize: fontMetrics.font.pointSize * 1.1
text: CallManager.callParty
text: CallManager.callPartyDisplayName
color: "#000000"
}

View file

@ -206,7 +206,9 @@ CallManager::sendInvite(const QString &roomid, CallType callType, unsigned int w
std::vector<RoomMember> members(cache::getMembers(roomid.toStdString()));
const RoomMember &callee =
members.front().user_id == utils::localUser() ? members.back() : members.front();
callParty_ = callee.display_name.isEmpty() ? callee.user_id : callee.display_name;
callParty_ = callee.user_id;
callPartyDisplayName_ =
callee.display_name.isEmpty() ? callee.user_id : callee.display_name;
callPartyAvatarUrl_ = QString::fromStdString(roomInfo.avatar_url);
emit newInviteState();
playRingtone(QUrl("qrc:/media/media/ringback.ogg"), true);
@ -308,7 +310,9 @@ CallManager::handleEvent(const RoomEvent<CallInvite> &callInviteEvent)
std::vector<RoomMember> members(cache::getMembers(callInviteEvent.room_id));
const RoomMember &caller =
members.front().user_id == utils::localUser() ? members.back() : members.front();
callParty_ = caller.display_name.isEmpty() ? caller.user_id : caller.display_name;
callParty_ = caller.user_id;
callPartyDisplayName_ =
caller.display_name.isEmpty() ? caller.user_id : caller.display_name;
callPartyAvatarUrl_ = QString::fromStdString(roomInfo.avatar_url);
haveCallInvite_ = true;
@ -459,6 +463,7 @@ CallManager::clear()
{
roomid_.clear();
callParty_.clear();
callPartyDisplayName_.clear();
callPartyAvatarUrl_.clear();
callid_.clear();
callType_ = CallType::VOICE;

View file

@ -32,6 +32,7 @@ class CallManager : public QObject
Q_PROPERTY(webrtc::CallType callType READ callType NOTIFY newInviteState)
Q_PROPERTY(webrtc::State callState READ callState NOTIFY newCallState)
Q_PROPERTY(QString callParty READ callParty NOTIFY newInviteState)
Q_PROPERTY(QString callPartyDisplayName READ callPartyDisplayName NOTIFY newInviteState)
Q_PROPERTY(QString callPartyAvatarUrl READ callPartyAvatarUrl NOTIFY newInviteState)
Q_PROPERTY(bool isMicMuted READ isMicMuted NOTIFY micMuteChanged)
Q_PROPERTY(bool haveLocalPiP READ haveLocalPiP NOTIFY newCallState)
@ -48,6 +49,7 @@ public:
webrtc::CallType callType() const { return callType_; }
webrtc::State callState() const { return session_.state(); }
QString callParty() const { return callParty_; }
QString callPartyDisplayName() const { return callPartyDisplayName_; }
QString callPartyAvatarUrl() const { return callPartyAvatarUrl_; }
bool isMicMuted() const { return session_.isMicMuted(); }
bool haveLocalPiP() const { return session_.haveLocalPiP(); }
@ -87,6 +89,7 @@ private:
WebRTCSession &session_;
QString roomid_;
QString callParty_;
QString callPartyDisplayName_;
QString callPartyAvatarUrl_;
std::string callid_;
const uint32_t timeoutms_ = 120000;