mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 09:30:47 +03:00
Enable Sticker and Emote messages
This commit is contained in:
parent
67d255a2de
commit
425d534e22
3 changed files with 14 additions and 9 deletions
|
@ -110,7 +110,9 @@ Rectangle {
|
|||
//case MtxEvent.Topic: return "delegates/Topic.qml"
|
||||
case MtxEvent.NoticeMessage: return "delegates/NoticeMessage.qml"
|
||||
case MtxEvent.TextMessage: return "delegates/TextMessage.qml"
|
||||
case MtxEvent.EmoteMessage: return "delegates/TextMessage.qml"
|
||||
case MtxEvent.ImageMessage: return "delegates/ImageMessage.qml"
|
||||
case MtxEvent.Sticker: return "delegates/ImageMessage.qml"
|
||||
case MtxEvent.FileMessage: return "delegates/FileMessage.qml"
|
||||
case MtxEvent.VideoMessage: return "delegates/PlayableMediaMessage.qml"
|
||||
case MtxEvent.AudioMessage: return "delegates/PlayableMediaMessage.qml"
|
||||
|
@ -204,7 +206,7 @@ Rectangle {
|
|||
onTriggered: chat.model.redactEvent(model.id)
|
||||
}
|
||||
MenuItem {
|
||||
visible: model.type == MtxEvent.ImageMessage || model.type == MtxEvent.VideoMessage || model.type == MtxEvent.AudioMessage || model.type == MtxEvent.FileMessage
|
||||
visible: model.type == MtxEvent.ImageMessage || model.type == MtxEvent.VideoMessage || model.type == MtxEvent.AudioMessage || model.type == MtxEvent.FileMessage || model.type == MtxEvent.Sticker
|
||||
text: qsTr("Save as")
|
||||
onTriggered: timelineManager.saveMedia(model.url, model.filename, model.mimetype, model.type)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import QtQuick 2.6
|
||||
|
||||
import com.github.nheko 1.0
|
||||
|
||||
Item {
|
||||
width: 300
|
||||
height: 300 * eventData.proportionalHeight
|
||||
|
@ -13,6 +15,7 @@ Item {
|
|||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
MouseArea {
|
||||
enabled: eventData.type == MtxEvent.ImageMessage
|
||||
anchors.fill: parent
|
||||
onClicked: timelineManager.openImageOverlay(eventData.url, eventData.filename, eventData.mimetype, eventData.type)
|
||||
}
|
||||
|
|
|
@ -16,26 +16,26 @@
|
|||
namespace {
|
||||
template<class T>
|
||||
QString
|
||||
eventId(const T &event)
|
||||
eventId(const mtx::events::RoomEvent<T> &event)
|
||||
{
|
||||
return QString::fromStdString(event.event_id);
|
||||
}
|
||||
template<class T>
|
||||
QString
|
||||
roomId(const T &event)
|
||||
roomId(const mtx::events::Event<T> &event)
|
||||
{
|
||||
return QString::fromStdString(event.room_id);
|
||||
}
|
||||
template<class T>
|
||||
QString
|
||||
senderId(const T &event)
|
||||
senderId(const mtx::events::RoomEvent<T> &event)
|
||||
{
|
||||
return QString::fromStdString(event.sender);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
QDateTime
|
||||
eventTimestamp(const T &event)
|
||||
eventTimestamp(const mtx::events::RoomEvent<T> &event)
|
||||
{
|
||||
return QDateTime::fromMSecsSinceEpoch(event.origin_server_ts);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ eventFormattedBody(const mtx::events::RoomEvent<T> &e)
|
|||
|
||||
template<class T>
|
||||
QString
|
||||
eventUrl(const T &)
|
||||
eventUrl(const mtx::events::Event<T> &)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ eventUrl(const mtx::events::RoomEvent<T> &e)
|
|||
|
||||
template<class T>
|
||||
QString
|
||||
eventFilename(const T &)
|
||||
eventFilename(const mtx::events::Event<T> &)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
@ -148,14 +148,14 @@ eventFilesize(const mtx::events::RoomEvent<T> &e) -> decltype(e.content.info.siz
|
|||
|
||||
template<class T>
|
||||
int64_t
|
||||
eventFilesize(const T &)
|
||||
eventFilesize(const mtx::events::Event<T> &)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
QString
|
||||
eventMimeType(const T &)
|
||||
eventMimeType(const mtx::events::Event<T> &)
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue