Merge branch 'master' into feature/userRegistration

This commit is contained in:
Sebastian Wolf 2020-10-04 12:27:25 +02:00 committed by GitHub
commit d79ecb8d4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 984 additions and 420 deletions

View file

@ -23,6 +23,7 @@ SOURCES += src/harbour-fernschreiber.cpp \
src/chatmodel.cpp \ src/chatmodel.cpp \
src/dbusadaptor.cpp \ src/dbusadaptor.cpp \
src/dbusinterface.cpp \ src/dbusinterface.cpp \
src/fernschreiberutils.cpp \
src/notificationmanager.cpp \ src/notificationmanager.cpp \
src/processlauncher.cpp \ src/processlauncher.cpp \
src/tdlibreceiver.cpp \ src/tdlibreceiver.cpp \
@ -103,6 +104,7 @@ HEADERS += \
src/chatmodel.h \ src/chatmodel.h \
src/dbusadaptor.h \ src/dbusadaptor.h \
src/dbusinterface.h \ src/dbusinterface.h \
src/fernschreiberutils.h \
src/notificationmanager.h \ src/notificationmanager.h \
src/processlauncher.h \ src/processlauncher.h \
src/tdlibreceiver.h \ src/tdlibreceiver.h \

View file

@ -124,6 +124,7 @@ function enhanceMessageText(formattedText) {
var messageText = formattedText.text; var messageText = formattedText.text;
messageText = messageText.replace("<", "&lt;"); messageText = messageText.replace("<", "&lt;");
messageText = messageText.replace(">", "&gt;"); messageText = messageText.replace(">", "&gt;");
messageText = messageText.replace("&", "&amp;");
var messageInsertions = []; var messageInsertions = [];
for (var i = 0; i < formattedText.entities.length; i++) { for (var i = 0; i < formattedText.entities.length; i++) {

View file

@ -231,8 +231,8 @@ Page {
pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), { "chatInformation" : display }); pageStack.push(Qt.resolvedUrl("../pages/ChatPage.qml"), { "chatInformation" : display });
} }
showMenuOnPressAndHold: chat_id != overviewPage.ownUserId
menu: ContextMenu { menu: ContextMenu {
visible: display.id !== overviewPage.ownUserId
MenuItem { MenuItem {
onClicked: { onClicked: {
var newNotificationSettings = display.notification_settings; var newNotificationSettings = display.notification_settings;
@ -241,28 +241,12 @@ Page {
} else { } else {
newNotificationSettings.mute_for = 6666666; newNotificationSettings.mute_for = 6666666;
} }
tdLibWrapper.setChatNotificationSettings(display.id, newNotificationSettings); tdLibWrapper.setChatNotificationSettings(chat_id, newNotificationSettings);
} }
text: display.notification_settings.mute_for > 0 ? qsTr("Unmute Chat") : qsTr("Mute Chat") text: display.notification_settings.mute_for > 0 ? qsTr("Unmute Chat") : qsTr("Mute Chat")
} }
} }
Connections {
target: chatListModel
onChatChanged: {
if (overviewPage.chatListCreated) {
// Force update of all list item elements. dataChanged() doesn't seem to trigger them all :(
chatListPictureThumbnail.photoData = (typeof display.photo !== "undefined") ? display.photo.small : "";
chatUnreadMessagesCountBackground.visible = display.unread_count > 0;
chatUnreadMessagesCount.text = display.unread_count > 99 ? "99+" : display.unread_count;
chatListNameText.text = display.title !== "" ? Emoji.emojify(display.title, Theme.fontSizeMedium) + ( display.notification_settings.mute_for > 0 ? Emoji.emojify(" 🔇", Theme.fontSizeMedium) : "" ) : qsTr("Unknown");
chatListLastUserText.text = (typeof display.last_message !== "undefined") ? ( display.last_message.sender_user_id !== overviewPage.ownUserId ? Emoji.emojify(Functions.getUserName(tdLibWrapper.getUserInformation(display.last_message.sender_user_id)), Theme.fontSizeExtraSmall) : qsTr("You") ) : qsTr("Unknown");
chatListLastMessageText.text = (typeof display.last_message !== "undefined") ? Emoji.emojify(Functions.getMessageText(display.last_message, true, display.last_message.sender_user_id === overviewPage.ownUserId), Theme.fontSizeExtraSmall) : qsTr("Unknown");
messageContactTimeElapsedText.text = (typeof display.last_message !== "undefined") ? Functions.getDateTimeElapsed(display.last_message.date) : qsTr("Unknown");
}
}
}
Column { Column {
id: chatListColumn id: chatListColumn
width: parent.width - ( 2 * Theme.horizontalPageMargin ) width: parent.width - ( 2 * Theme.horizontalPageMargin )
@ -291,7 +275,7 @@ Page {
ProfileThumbnail { ProfileThumbnail {
id: chatListPictureThumbnail id: chatListPictureThumbnail
photoData: (typeof display.photo !== "undefined") ? display.photo.small : "" photoData: photo_small
replacementStringHint: chatListNameText.text replacementStringHint: chatListNameText.text
width: parent.width width: parent.width
height: parent.width height: parent.width
@ -306,7 +290,7 @@ Page {
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
radius: parent.width / 2 radius: parent.width / 2
visible: display.unread_count > 0 visible: unread_count > 0
} }
Text { Text {
@ -316,7 +300,7 @@ Page {
color: Theme.primaryColor color: Theme.primaryColor
anchors.centerIn: chatUnreadMessagesCountBackground anchors.centerIn: chatUnreadMessagesCountBackground
visible: chatUnreadMessagesCountBackground.visible visible: chatUnreadMessagesCountBackground.visible
text: display.unread_count > 99 ? "99+" : display.unread_count text: unread_count > 99 ? "99+" : unread_count
} }
} }
} }
@ -328,7 +312,7 @@ Page {
Text { Text {
id: chatListNameText id: chatListNameText
text: display.title !== "" ? Emoji.emojify(display.title, Theme.fontSizeMedium) + ( display.notification_settings.mute_for > 0 ? Emoji.emojify(" 🔇", Theme.fontSizeMedium) : "" ) : qsTr("Unknown") text: title ? Emoji.emojify(title, Theme.fontSizeMedium) + ( display.notification_settings.mute_for > 0 ? Emoji.emojify(" 🔇", Theme.fontSizeMedium) : "" ) : qsTr("Unknown")
textFormat: Text.StyledText textFormat: Text.StyledText
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: Theme.primaryColor color: Theme.primaryColor
@ -349,7 +333,7 @@ Page {
spacing: Theme.paddingSmall spacing: Theme.paddingSmall
Text { Text {
id: chatListLastUserText id: chatListLastUserText
text: (typeof display.last_message !== "undefined") ? ( display.last_message.sender_user_id !== overviewPage.ownUserId ? Emoji.emojify(Functions.getUserName(tdLibWrapper.getUserInformation(display.last_message.sender_user_id)), font.pixelSize) : qsTr("You") ) : qsTr("Unknown") text: is_channel ? "" : ( last_message_sender_id ? ( last_message_sender_id !== overviewPage.ownUserId ? Emoji.emojify(Functions.getUserName(tdLibWrapper.getUserInformation(last_message_sender_id)), font.pixelSize) : qsTr("You") ) : qsTr("Unknown") )
font.pixelSize: Theme.fontSizeExtraSmall font.pixelSize: Theme.fontSizeExtraSmall
color: Theme.highlightColor color: Theme.highlightColor
textFormat: Text.StyledText textFormat: Text.StyledText
@ -363,7 +347,7 @@ Page {
} }
Text { Text {
id: chatListLastMessageText id: chatListLastMessageText
text: (typeof display.last_message !== "undefined") ? Emoji.emojify(Functions.getMessageText(display.last_message, true, display.last_message.sender_user_id === overviewPage.ownUserId), Theme.fontSizeExtraSmall) : qsTr("Unknown") text: last_message_text ? Emoji.emojify(last_message_text, Theme.fontSizeExtraSmall) : qsTr("Unknown")
font.pixelSize: Theme.fontSizeExtraSmall font.pixelSize: Theme.fontSizeExtraSmall
color: Theme.primaryColor color: Theme.primaryColor
width: parent.width - Theme.paddingMedium - chatListLastUserText.width width: parent.width - Theme.paddingMedium - chatListLastUserText.width
@ -379,28 +363,9 @@ Page {
} }
} }
Timer {
id: messageContactTimeUpdater
interval: 60000
running: true
repeat: true
onTriggered: {
if (typeof display.last_message !== "undefined") {
messageContactTimeElapsedText.text = Functions.getDateTimeElapsed(display.last_message.date);
// Force update of all list item elements. dataChanged() doesn't seem to trigger them all :(
chatListPictureThumbnail.photoData = (typeof display.photo !== "undefined") ? display.photo.small : "";
chatUnreadMessagesCountBackground.visible = display.unread_count > 0;
chatUnreadMessagesCount.text = display.unread_count > 99 ? "99+" : display.unread_count;
chatListNameText.text = display.title !== "" ? Emoji.emojify(display.title, Theme.fontSizeMedium) + ( display.notification_settings.mute_for > 0 ? Emoji.emojify(" 🔇", Theme.fontSizeMedium) : "" ) : qsTr("Unknown");
chatListLastUserText.text = (typeof display.last_message !== "undefined") ? ( display.last_message.sender_user_id !== overviewPage.ownUserId ? Emoji.emojify(Functions.getUserName(tdLibWrapper.getUserInformation(display.last_message.sender_user_id)), Theme.fontSizeExtraSmall) : qsTr("You") ) : qsTr("Unknown");
chatListLastMessageText.text = (typeof display.last_message !== "undefined") ? Emoji.emojify(Functions.getMessageText(display.last_message, true, display.last_message.sender_user_id === overviewPage.ownUserId), Theme.fontSizeExtraSmall) : qsTr("Unknown");
}
}
}
Text { Text {
id: messageContactTimeElapsedText id: messageContactTimeElapsedText
text: (typeof display.last_message !== "undefined") ? Functions.getDateTimeElapsed(display.last_message.date) : qsTr("Unknown") text: last_message_date ? Functions.getDateTimeElapsed(last_message_date) : qsTr("Unknown")
font.pixelSize: Theme.fontSizeTiny font.pixelSize: Theme.fontSizeTiny
color: Theme.secondaryColor color: Theme.secondaryColor
} }

View file

@ -18,41 +18,80 @@
*/ */
#include "chatlistmodel.h" #include "chatlistmodel.h"
#include <QListIterator> #include "fernschreiberutils.h"
#include <QDebug> #include <QDebug>
#define LOG(x) qDebug() << "[ChatListModel]" << x #define LOG(x) qDebug() << "[ChatListModel]" << x
namespace { namespace {
const QString ID("id"); const QString ID("id");
const QString DATE("date");
const QString TEXT("text");
const QString TITLE("title");
const QString PHOTO("photo");
const QString SMALL("small");
const QString ORDER("order"); const QString ORDER("order");
const QString CHAT_ID("chat_id"); const QString CHAT_ID("chat_id");
const QString CONTENT("content");
const QString LAST_MESSAGE("last_message"); const QString LAST_MESSAGE("last_message");
const QString SENDER_USER_ID("sender_user_id");
const QString UNREAD_COUNT("unread_count"); const QString UNREAD_COUNT("unread_count");
const QString NOTIFICATION_SETTINGS("notification_settings"); const QString NOTIFICATION_SETTINGS("notification_settings");
const QString LAST_READ_INBOX_MESSAGE_ID("last_read_inbox_message_id"); const QString LAST_READ_INBOX_MESSAGE_ID("last_read_inbox_message_id");
const QString LAST_READ_OUTBOX_MESSAGE_ID("last_read_outbox_message_id"); const QString LAST_READ_OUTBOX_MESSAGE_ID("last_read_outbox_message_id");
const QString TYPE_MAP("type");
const QString IS_CHANNEL("is_channel");
const QString TYPE("@type");
const QString TYPE_MESSAGE_TEXT("messageText");
} }
class ChatListModel::ChatData class ChatListModel::ChatData
{ {
public: public:
ChatData(const QVariantMap &data); enum Role {
RoleDisplay = Qt::DisplayRole,
RoleChatId,
RoleTitle,
RolePhotoSmall,
RoleUnreadCount,
RoleLastReadInboxMessageId,
RoleLastMessageSenderId,
RoleLastMessageDate,
RoleLastMessageText,
RoleIsChannel
};
ChatData(const QVariantMap &data, const QVariantMap &userInformation);
int compareTo(const ChatData *chat) const; int compareTo(const ChatData *chat) const;
bool setOrder(const QString &order); bool setOrder(const QString &order);
const QVariant lastMessage(const QString &key) const;
QString title() const;
int unreadCount() const;
QVariant photoSmall() const;
qlonglong lastReadInboxMessageId() const;
qlonglong senderUserId() const;
qlonglong senderMessageDate() const;
QString senderMessageText() const;
bool isChannel() const;
bool updateUnreadCount(int unreadCount);
bool updateLastReadInboxMessageId(qlonglong messageId);
QVector<int> updateLastMessage(const QVariantMap &message);
public: public:
QVariantMap chatData; QVariantMap chatData;
QString chatId; QString chatId;
qlonglong order; qlonglong order;
QVariantMap userInformation;
}; };
ChatListModel::ChatData::ChatData(const QVariantMap &data) : ChatListModel::ChatData::ChatData(const QVariantMap &data, const QVariantMap &userInformation) :
chatData(data), chatData(data),
chatId(data.value(ID).toString()), chatId(data.value(ID).toString()),
order(data.value(ORDER).toLongLong()) order(data.value(ORDER).toLongLong())
{ {
this->userInformation = userInformation;
} }
int ChatListModel::ChatData::compareTo(const ChatData *other) const int ChatListModel::ChatData::compareTo(const ChatData *other) const
@ -75,6 +114,87 @@ bool ChatListModel::ChatData::setOrder(const QString &newOrder)
return false; return false;
} }
inline const QVariant ChatListModel::ChatData::lastMessage(const QString &key) const
{
return chatData.value(LAST_MESSAGE).toMap().value(key);
}
QString ChatListModel::ChatData::title() const
{
return chatData.value(TITLE).toString();
}
int ChatListModel::ChatData::unreadCount() const
{
return chatData.value(UNREAD_COUNT).toInt();
}
QVariant ChatListModel::ChatData::photoSmall() const
{
return chatData.value(PHOTO).toMap().value(SMALL);
}
qlonglong ChatListModel::ChatData::lastReadInboxMessageId() const
{
return chatData.value(LAST_READ_INBOX_MESSAGE_ID).toLongLong();
}
qlonglong ChatListModel::ChatData::senderUserId() const
{
return lastMessage(SENDER_USER_ID).toLongLong();
}
qlonglong ChatListModel::ChatData::senderMessageDate() const
{
return lastMessage(DATE).toLongLong();
}
QString ChatListModel::ChatData::senderMessageText() const
{
return FernschreiberUtils::getMessageShortText(lastMessage(CONTENT).toMap(), this->userInformation.value(ID).toLongLong() == senderUserId());
}
bool ChatListModel::ChatData::isChannel() const
{
return chatData.value(TYPE_MAP).toMap().value(IS_CHANNEL).toBool();
}
bool ChatListModel::ChatData::updateUnreadCount(int count)
{
const int prevUnreadCount(unreadCount());
chatData.insert(UNREAD_COUNT, count);
return prevUnreadCount != unreadCount();
}
bool ChatListModel::ChatData::updateLastReadInboxMessageId(qlonglong messageId)
{
const qlonglong prevLastReadInboxMessageId(lastReadInboxMessageId());
chatData.insert(LAST_READ_INBOX_MESSAGE_ID, messageId);
return prevLastReadInboxMessageId != lastReadInboxMessageId();
}
QVector<int> ChatListModel::ChatData::updateLastMessage(const QVariantMap &message)
{
const qlonglong prevSenderUserId(senderUserId());
const qlonglong prevSenderMessageDate(senderMessageDate());
const QString prevSenderMessageText(senderMessageText());
chatData.insert(LAST_MESSAGE, message);
QVector<int> changedRoles;
changedRoles.append(RoleDisplay);
if (prevSenderUserId != senderUserId()) {
changedRoles.append(RoleLastMessageSenderId);
}
if (prevSenderMessageDate != senderMessageDate()) {
changedRoles.append(RoleLastMessageDate);
}
if (prevSenderMessageText != senderMessageText()) {
changedRoles.append(RoleLastMessageText);
}
return changedRoles;
}
ChatListModel::ChatListModel(TDLibWrapper *tdLibWrapper) ChatListModel::ChatListModel(TDLibWrapper *tdLibWrapper)
{ {
this->tdLibWrapper = tdLibWrapper; this->tdLibWrapper = tdLibWrapper;
@ -85,6 +205,12 @@ ChatListModel::ChatListModel(TDLibWrapper *tdLibWrapper)
connect(tdLibWrapper, SIGNAL(chatReadOutboxUpdated(QString, QString)), this, SLOT(handleChatReadOutboxUpdated(QString, QString))); connect(tdLibWrapper, SIGNAL(chatReadOutboxUpdated(QString, QString)), this, SLOT(handleChatReadOutboxUpdated(QString, QString)));
connect(tdLibWrapper, SIGNAL(messageSendSucceeded(QString, QString, QVariantMap)), this, SLOT(handleMessageSendSucceeded(QString, QString, QVariantMap))); connect(tdLibWrapper, SIGNAL(messageSendSucceeded(QString, QString, QVariantMap)), this, SLOT(handleMessageSendSucceeded(QString, QString, QVariantMap)));
connect(tdLibWrapper, SIGNAL(chatNotificationSettingsUpdated(QString, QVariantMap)), this, SLOT(handleChatNotificationSettingsUpdated(QString, QVariantMap))); connect(tdLibWrapper, SIGNAL(chatNotificationSettingsUpdated(QString, QVariantMap)), this, SLOT(handleChatNotificationSettingsUpdated(QString, QVariantMap)));
// Don't start the timer until we have at least one chat
relativeTimeRefreshTimer = new QTimer(this);
relativeTimeRefreshTimer->setSingleShot(false);
relativeTimeRefreshTimer->setInterval(30000);
connect(relativeTimeRefreshTimer, SIGNAL(timeout()), SLOT(handleRelativeTimeRefreshTimer()));
} }
ChatListModel::~ChatListModel() ChatListModel::~ChatListModel()
@ -93,6 +219,22 @@ ChatListModel::~ChatListModel()
qDeleteAll(chatList); qDeleteAll(chatList);
} }
QHash<int,QByteArray> ChatListModel::roleNames() const
{
QHash<int,QByteArray> roles;
roles.insert(ChatData::RoleDisplay, "display");
roles.insert(ChatData::RoleChatId, "chat_id");
roles.insert(ChatData::RoleTitle, "title");
roles.insert(ChatData::RolePhotoSmall, "photo_small");
roles.insert(ChatData::RoleUnreadCount, "unread_count");
roles.insert(ChatData::RoleLastReadInboxMessageId, "last_read_inbox_message_id");
roles.insert(ChatData::RoleLastMessageSenderId, "last_message_sender_id");
roles.insert(ChatData::RoleLastMessageDate, "last_message_date");
roles.insert(ChatData::RoleLastMessageText, "last_message_text");
roles.insert(ChatData::RoleIsChannel, "is_channel");
return roles;
}
int ChatListModel::rowCount(const QModelIndex &) const int ChatListModel::rowCount(const QModelIndex &) const
{ {
return chatList.size(); return chatList.size();
@ -101,8 +243,20 @@ int ChatListModel::rowCount(const QModelIndex &) const
QVariant ChatListModel::data(const QModelIndex &index, int role) const QVariant ChatListModel::data(const QModelIndex &index, int role) const
{ {
const int row = index.row(); const int row = index.row();
if (row >= 0 && row < chatList.size() && role == Qt::DisplayRole) { if (row >= 0 && row < chatList.size()) {
return chatList.at(row)->chatData; const ChatData *data = chatList.at(row);
switch ((ChatData::Role)role) {
case ChatData::RoleDisplay: return data->chatData;
case ChatData::RoleChatId: return data->chatId;
case ChatData::RoleTitle: return data->title();
case ChatData::RolePhotoSmall: return data->photoSmall();
case ChatData::RoleUnreadCount: return data->unreadCount();
case ChatData::RoleLastReadInboxMessageId: return data->lastReadInboxMessageId();
case ChatData::RoleLastMessageSenderId: return data->senderUserId();
case ChatData::RoleLastMessageText: return data->senderMessageText();
case ChatData::RoleLastMessageDate: return data->senderMessageDate();
case ChatData::RoleIsChannel: return data->isChannel();
}
} }
return QVariant(); return QVariant();
} }
@ -115,7 +269,7 @@ void ChatListModel::redrawModel()
int ChatListModel::updateChatOrder(int chatIndex) int ChatListModel::updateChatOrder(int chatIndex)
{ {
ChatData* chat = chatList.at(chatIndex); ChatData *chat = chatList.at(chatIndex);
const int n = chatList.size(); const int n = chatList.size();
int newIndex = chatIndex; int newIndex = chatIndex;
@ -155,7 +309,7 @@ int ChatListModel::updateChatOrder(int chatIndex)
void ChatListModel::handleChatDiscovered(const QString &chatId, const QVariantMap &chatToBeAdded) void ChatListModel::handleChatDiscovered(const QString &chatId, const QVariantMap &chatToBeAdded)
{ {
ChatData* chat = new ChatData(chatToBeAdded); ChatData *chat = new ChatData(chatToBeAdded, tdLibWrapper->getUserInformation());
const int n = chatList.size(); const int n = chatList.size();
int chatIndex; int chatIndex;
for (chatIndex = 0; chatIndex < n && chat->compareTo(chatList.at(chatIndex)) >= 0; chatIndex++); for (chatIndex = 0; chatIndex < n && chat->compareTo(chatList.at(chatIndex)) >= 0; chatIndex++);
@ -168,6 +322,11 @@ void ChatListModel::handleChatDiscovered(const QString &chatId, const QVariantMa
chatIndexMap.insert(chatList.at(i)->chatId, i); chatIndexMap.insert(chatList.at(i)->chatId, i);
} }
endInsertRows(); endInsertRows();
// Start timestamp refresh timer when the first chat is discovered
if (!relativeTimeRefreshTimer->isActive()) {
relativeTimeRefreshTimer->start();
}
} }
void ChatListModel::handleChatLastMessageUpdated(const QString &chatId, const QString &order, const QVariantMap &lastMessage) void ChatListModel::handleChatLastMessageUpdated(const QString &chatId, const QString &order, const QVariantMap &lastMessage)
@ -175,14 +334,12 @@ void ChatListModel::handleChatLastMessageUpdated(const QString &chatId, const QS
if (chatIndexMap.contains(chatId)) { if (chatIndexMap.contains(chatId)) {
int chatIndex = chatIndexMap.value(chatId); int chatIndex = chatIndexMap.value(chatId);
LOG("Updating last message for chat" << chatId <<" at index" << chatIndex << "new order" << order); LOG("Updating last message for chat" << chatId <<" at index" << chatIndex << "new order" << order);
ChatData* chat = chatList.at(chatIndex); ChatData *chat = chatList.at(chatIndex);
chat->chatData.insert(LAST_MESSAGE, lastMessage);
if (chat->setOrder(order)) { if (chat->setOrder(order)) {
chatIndex = updateChatOrder(chatIndex); chatIndex = updateChatOrder(chatIndex);
} }
const QModelIndex modelIndex(index(chatIndex)); const QModelIndex modelIndex(index(chatIndex));
emit dataChanged(modelIndex, modelIndex); emit dataChanged(modelIndex, modelIndex, chat->updateLastMessage(lastMessage));
emit chatChanged(chatId);
} }
} }
@ -192,25 +349,27 @@ void ChatListModel::handleChatOrderUpdated(const QString &chatId, const QString
LOG("Updating chat order of" << chatId << "to" << order); LOG("Updating chat order of" << chatId << "to" << order);
int chatIndex = chatIndexMap.value(chatId); int chatIndex = chatIndexMap.value(chatId);
if (chatList.at(chatIndex)->setOrder(order)) { if (chatList.at(chatIndex)->setOrder(order)) {
chatIndex = updateChatOrder(chatIndex); updateChatOrder(chatIndex);
} }
const QModelIndex modelIndex(index(chatIndex));
emit dataChanged(modelIndex, modelIndex);
emit chatChanged(chatId);
} }
} }
void ChatListModel::handleChatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, const int &unreadCount) void ChatListModel::handleChatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, int unreadCount)
{ {
if (chatIndexMap.contains(chatId)) { if (chatIndexMap.contains(chatId)) {
LOG("Updating chat unread count for" << chatId << "unread messages" << unreadCount << ", last read message ID: " << lastReadInboxMessageId); LOG("Updating chat unread count for" << chatId << "unread messages" << unreadCount << ", last read message ID: " << lastReadInboxMessageId);
const int chatIndex = chatIndexMap.value(chatId); const int chatIndex = chatIndexMap.value(chatId);
ChatData* chat = chatList.at(chatIndex); ChatData *chat = chatList.at(chatIndex);
chat->chatData.insert(UNREAD_COUNT, unreadCount); QVector<int> changedRoles;
chat->chatData.insert(LAST_READ_INBOX_MESSAGE_ID, lastReadInboxMessageId); changedRoles.append(ChatData::RoleDisplay);
if (chat->updateUnreadCount(unreadCount)) {
changedRoles.append(ChatData::RoleUnreadCount);
}
if (chat->updateLastReadInboxMessageId(lastReadInboxMessageId.toLongLong())) {
changedRoles.append(ChatData::RoleLastReadInboxMessageId);
}
const QModelIndex modelIndex(index(chatIndex)); const QModelIndex modelIndex(index(chatIndex));
emit dataChanged(modelIndex, modelIndex); emit dataChanged(modelIndex, modelIndex, changedRoles);
emit chatChanged(chatId);
} }
} }
@ -219,11 +378,10 @@ void ChatListModel::handleChatReadOutboxUpdated(const QString &chatId, const QSt
if (chatIndexMap.contains(chatId)) { if (chatIndexMap.contains(chatId)) {
LOG("Updating last read message for" << chatId << "last ID" << lastReadOutboxMessageId); LOG("Updating last read message for" << chatId << "last ID" << lastReadOutboxMessageId);
const int chatIndex = chatIndexMap.value(chatId); const int chatIndex = chatIndexMap.value(chatId);
ChatData* chat = chatList.at(chatIndex); ChatData *chat = chatList.at(chatIndex);
chat->chatData.insert(LAST_READ_OUTBOX_MESSAGE_ID, lastReadOutboxMessageId); chat->chatData.insert(LAST_READ_OUTBOX_MESSAGE_ID, lastReadOutboxMessageId);
const QModelIndex modelIndex(index(chatIndex)); const QModelIndex modelIndex(index(chatIndex));
emit dataChanged(modelIndex, modelIndex); emit dataChanged(modelIndex, modelIndex);
emit chatChanged(chatId);
} }
} }
@ -233,11 +391,8 @@ void ChatListModel::handleMessageSendSucceeded(const QString &messageId, const Q
if (chatIndexMap.contains(chatId)) { if (chatIndexMap.contains(chatId)) {
const int chatIndex = chatIndexMap.value(chatId); const int chatIndex = chatIndexMap.value(chatId);
LOG("Updating last message for chat" << chatId << "at index" << chatIndex << ", as message was sent, old ID:" << oldMessageId << ", new ID:" << messageId); LOG("Updating last message for chat" << chatId << "at index" << chatIndex << ", as message was sent, old ID:" << oldMessageId << ", new ID:" << messageId);
ChatData* chat = chatList.at(chatIndex);
chat->chatData.insert(LAST_MESSAGE, message);
const QModelIndex modelIndex(index(chatIndex)); const QModelIndex modelIndex(index(chatIndex));
emit dataChanged(modelIndex, modelIndex); emit dataChanged(modelIndex, modelIndex, chatList.at(chatIndex)->updateLastMessage(message));
emit chatChanged(chatId);
} }
} }
@ -246,10 +401,17 @@ void ChatListModel::handleChatNotificationSettingsUpdated(const QString &chatId,
if (chatIndexMap.contains(chatId)) { if (chatIndexMap.contains(chatId)) {
const int chatIndex = chatIndexMap.value(chatId); const int chatIndex = chatIndexMap.value(chatId);
LOG("Updating notification settings for chat" << chatId << "at index" << chatIndex); LOG("Updating notification settings for chat" << chatId << "at index" << chatIndex);
ChatData* chat = chatList.at(chatIndex); ChatData *chat = chatList.at(chatIndex);
chat->chatData.insert(NOTIFICATION_SETTINGS, chatNotificationSettings); chat->chatData.insert(NOTIFICATION_SETTINGS, chatNotificationSettings);
const QModelIndex modelIndex(index(chatIndex)); const QModelIndex modelIndex(index(chatIndex));
emit dataChanged(modelIndex, modelIndex); emit dataChanged(modelIndex, modelIndex);
emit chatChanged(chatId);
} }
} }
void ChatListModel::handleRelativeTimeRefreshTimer()
{
LOG("Refreshing timestamps");
QVector<int> roles;
roles.append(ChatData::RoleLastMessageDate);
emit dataChanged(index(0), index(chatList.size() - 1), roles);
}

View file

@ -21,8 +21,6 @@
#define CHATLISTMODEL_H #define CHATLISTMODEL_H
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QDebug>
#include <QMutex>
#include "tdlibwrapper.h" #include "tdlibwrapper.h"
class ChatListModel : public QAbstractListModel class ChatListModel : public QAbstractListModel
@ -32,22 +30,21 @@ public:
ChatListModel(TDLibWrapper *tdLibWrapper); ChatListModel(TDLibWrapper *tdLibWrapper);
~ChatListModel() override; ~ChatListModel() override;
virtual QHash<int,QByteArray> roleNames() const override;
virtual int rowCount(const QModelIndex&) const override; virtual int rowCount(const QModelIndex&) const override;
virtual QVariant data(const QModelIndex &index, int role) const override; virtual QVariant data(const QModelIndex &index, int role) const override;
Q_INVOKABLE void redrawModel(); Q_INVOKABLE void redrawModel();
signals:
void chatChanged(const QString &chatId);
private slots: private slots:
void handleChatDiscovered(const QString &chatId, const QVariantMap &chatInformation); void handleChatDiscovered(const QString &chatId, const QVariantMap &chatInformation);
void handleChatLastMessageUpdated(const QString &chatId, const QString &order, const QVariantMap &lastMessage); void handleChatLastMessageUpdated(const QString &chatId, const QString &order, const QVariantMap &lastMessage);
void handleChatOrderUpdated(const QString &chatId, const QString &order); void handleChatOrderUpdated(const QString &chatId, const QString &order);
void handleChatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, const int &unreadCount); void handleChatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, int unreadCount);
void handleChatReadOutboxUpdated(const QString &chatId, const QString &lastReadOutboxMessageId); void handleChatReadOutboxUpdated(const QString &chatId, const QString &lastReadOutboxMessageId);
void handleMessageSendSucceeded(const QString &messageId, const QString &oldMessageId, const QVariantMap &message); void handleMessageSendSucceeded(const QString &messageId, const QString &oldMessageId, const QVariantMap &message);
void handleChatNotificationSettingsUpdated(const QString &chatId, const QVariantMap &chatNotificationSettings); void handleChatNotificationSettingsUpdated(const QString &chatId, const QVariantMap &chatNotificationSettings);
void handleRelativeTimeRefreshTimer();
private: private:
int updateChatOrder(int chatIndex); int updateChatOrder(int chatIndex);
@ -56,6 +53,7 @@ private:
class ChatData; class ChatData;
TDLibWrapper *tdLibWrapper; TDLibWrapper *tdLibWrapper;
QTimer *relativeTimeRefreshTimer;
QList<ChatData*> chatList; QList<ChatData*> chatList;
QHash<QString,int> chatIndexMap; QHash<QString,int> chatIndexMap;
}; };

View file

@ -0,0 +1,55 @@
#include "fernschreiberutils.h"
#include <QMap>
#include <QVariant>
FernschreiberUtils::FernschreiberUtils(QObject *parent) : QObject(parent)
{
}
QString FernschreiberUtils::getMessageShortText(const QVariantMap &messageContent, const bool &myself)
{
QString contentType = messageContent.value("@type").toString();
if (contentType == "messageText") {
return messageContent.value("text").toMap().value("text").toString();
}
if (contentType == "messageSticker") {
return tr("Sticker: %1").arg(messageContent.value("sticker").toMap().value("emoji").toString());
}
if (contentType == "messagePhoto") {
return myself ? tr("sent a picture", "myself") : tr("sent a picture");
}
if (contentType == "messageVideo") {
return myself ? tr("sent a video", "myself") : tr("sent a video");
}
if (contentType == "messageAnimation") {
return myself ? tr("sent an animation", "myself") : tr("sent an animation");
}
if (contentType == "messageVoiceNote") {
return myself ? tr("sent a voice note", "myself") : tr("sent a voice note");
}
if (contentType == "messageDocument") {
return myself ? tr("sent a document", "myself") : tr("sent a document");
}
if (contentType == "messageLocation") {
return myself ? tr("sent a location", "myself") : tr("sent a location");
}
if (contentType == "messageVenue") {
return myself ? tr("sent a venue", "myself") : tr("sent a venue");
}
if (contentType == "messageContactRegistered") {
return myself ? tr("have registered with Telegram", "myself") : tr("has registered with Telegram");
}
if (contentType == "messageChatJoinByLink") {
return myself ? tr("joined this chat", "myself") : tr("joined this chat");
}
if (contentType == "messageChatAddMembers") {
return myself ? tr("were added to this chat", "myself") : tr("was added to this chat");
}
if (contentType == "messageChatDeleteMember") {
return myself ? tr("left this chat", "myself") : tr("left this chat");
}
return tr("Unsupported message: %1").arg(contentType.mid(7));
}

19
src/fernschreiberutils.h Normal file
View file

@ -0,0 +1,19 @@
#ifndef FERNSCHREIBERUTILS_H
#define FERNSCHREIBERUTILS_H
#include <QObject>
class FernschreiberUtils : public QObject
{
Q_OBJECT
public:
explicit FernschreiberUtils(QObject *parent = nullptr);
static QString getMessageShortText(const QVariantMap &messageContent, const bool &myself);
signals:
public slots:
};
#endif // FERNSCHREIBERUTILS_H

View file

@ -18,6 +18,7 @@
*/ */
#include "notificationmanager.h" #include "notificationmanager.h"
#include "fernschreiberutils.h"
#include <nemonotifications-qt5/notification.h> #include <nemonotifications-qt5/notification.h>
#include <sailfishapp.h> #include <sailfishapp.h>
#include <QDebug> #include <QDebug>
@ -219,42 +220,7 @@ QString NotificationManager::getNotificationText(const QVariantMap &notification
{ {
qDebug() << "[NotificationManager] Getting notification text from content" << notificationContent; qDebug() << "[NotificationManager] Getting notification text from content" << notificationContent;
QString contentType = notificationContent.value("@type").toString(); return FernschreiberUtils::getMessageShortText(notificationContent, false);
if (contentType == "messageText") {
return notificationContent.value("text").toMap().value("text").toString();
}
if (contentType == "messagePhoto") {
return tr("sent a picture");
}
if (contentType == "messageVideo") {
return tr("sent a video");
}
if (contentType == "messageAnimation") {
return tr("sent an animation");
}
if (contentType == "messageVoiceNote") {
return tr("sent a voice note");
}
if (contentType == "messageDocument") {
return tr("sent a document");
}
if (contentType == "messageLocation") {
return tr("sent a location");
}
if (contentType == "messageContactRegistered") {
return tr("has registered with Telegram");
}
if (contentType == "messageChatJoinByLink") {
return tr("joined this chat");
}
if (contentType == "messageChatAddMembers") {
return tr("was added to this chat");
}
if (contentType == "messageChatDeleteMember") {
return tr("left this chat");
}
return tr("Unsupported message: %1").arg(contentType.mid(7));
} }
void NotificationManager::controlLedNotification(const bool &enabled) void NotificationManager::controlLedNotification(const bool &enabled)

View file

@ -228,6 +228,116 @@
<translation>Dokument öffnen</translation> <translation>Dokument öffnen</translation>
</message> </message>
</context> </context>
<context>
<name>FernschreiberUtils</name>
<message>
<source>sent a picture</source>
<comment>myself</comment>
<translation>haben ein Bild geschickt</translation>
</message>
<message>
<source>sent a picture</source>
<translation>hat ein Bild geschickt</translation>
</message>
<message>
<source>sent a video</source>
<comment>myself</comment>
<translation>haben ein Video geschickt</translation>
</message>
<message>
<source>sent a video</source>
<translation>hat ein Video geschickt</translation>
</message>
<message>
<source>sent an animation</source>
<comment>myself</comment>
<translation>haben eine Animation geschickt</translation>
</message>
<message>
<source>sent an animation</source>
<translation>hat eine Animation geschickt</translation>
</message>
<message>
<source>sent a voice note</source>
<translation>hat eine Sprachnachricht geschickt</translation>
</message>
<message>
<source>sent a document</source>
<comment>myself</comment>
<translation>haben ein Dokument geschickt</translation>
</message>
<message>
<source>sent a document</source>
<translation>hat ein Dokument geschickt</translation>
</message>
<message>
<source>sent a location</source>
<comment>myself</comment>
<translation>haben einen Standort geschickt</translation>
</message>
<message>
<source>sent a location</source>
<translation>hat einen Standort geschickt</translation>
</message>
<message>
<source>have registered with Telegram</source>
<comment>myself</comment>
<translation>haben sich bei Telegram angemeldet</translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation>hat sich bei Telegram angemeldet</translation>
</message>
<message>
<source>joined this chat</source>
<comment>myself</comment>
<translation>sind diesem Chat beigetreten</translation>
</message>
<message>
<source>joined this chat</source>
<translation>ist diesem Chat beigetreten</translation>
</message>
<message>
<source>were added to this chat</source>
<comment>myself</comment>
<translation>wurden diesem Chat hinzugefügt</translation>
</message>
<message>
<source>was added to this chat</source>
<translation>wurde diesem Chat hinzugefügt</translation>
</message>
<message>
<source>left this chat</source>
<comment>myself</comment>
<translation>haben diesen Chat verlassen</translation>
</message>
<message>
<source>left this chat</source>
<translation>hat diesen Chat verlassen</translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation>Nicht unterstützte Nachricht: %1</translation>
</message>
<message>
<source>Sticker: %1</source>
<translation>Sticker: %1</translation>
</message>
<message>
<source>sent a voice note</source>
<comment>myself</comment>
<translation>haben eine Sprachnachricht geschickt</translation>
</message>
<message>
<source>sent a venue</source>
<comment>myself</comment>
<translation>haben einen Ort geschickt</translation>
</message>
<message>
<source>sent a venue</source>
<translation>hat einen Ort geschickt</translation>
</message>
</context>
<context> <context>
<name>ImagePage</name> <name>ImagePage</name>
<message> <message>
@ -313,7 +423,7 @@
<name>LocationPreview</name> <name>LocationPreview</name>
<message> <message>
<source>Install Pure Maps to inspect this location.</source> <source>Install Pure Maps to inspect this location.</source>
<translation>Installieren Sie Pure Maps, um diesen Ort zu erkunden</translation> <translation>Installieren Sie Pure Maps, um diesen Ort zu erkunden.</translation>
</message> </message>
</context> </context>
<context> <context>
@ -322,50 +432,6 @@
<source>%1 unread messages</source> <source>%1 unread messages</source>
<translation>%1 ungelesene Nachrichten</translation> <translation>%1 ungelesene Nachrichten</translation>
</message> </message>
<message>
<source>sent a picture</source>
<translation>hat ein Bild geschickt</translation>
</message>
<message>
<source>sent a video</source>
<translation>hat ein Video geschickt</translation>
</message>
<message>
<source>sent an animation</source>
<translation>hat eine Animation geschickt</translation>
</message>
<message>
<source>sent a voice note</source>
<translation>hat eine Sprachnachricht geschickt</translation>
</message>
<message>
<source>sent a document</source>
<translation>hat ein Dokument geschickt</translation>
</message>
<message>
<source>sent a location</source>
<translation>hat einen Ort geschickt</translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation>hat sich bei Telegram angemeldet</translation>
</message>
<message>
<source>joined this chat</source>
<translation>ist diesem Chat beigetreten</translation>
</message>
<message>
<source>was added to this chat</source>
<translation>wurde diesem Chat hinzugefügt</translation>
</message>
<message>
<source>left this chat</source>
<translation>hat diesen Chat verlassen</translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation>Nicht unterstützte Nachricht: %1</translation>
</message>
</context> </context>
<context> <context>
<name>OverviewPage</name> <name>OverviewPage</name>

View file

@ -228,6 +228,116 @@
<translation>Abrir Documento</translation> <translation>Abrir Documento</translation>
</message> </message>
</context> </context>
<context>
<name>FernschreiberUtils</name>
<message>
<source>sent a picture</source>
<comment>myself</comment>
<translation type="unfinished">envió una imagen</translation>
</message>
<message>
<source>sent a picture</source>
<translation type="unfinished">envió una imagen</translation>
</message>
<message>
<source>sent a video</source>
<comment>myself</comment>
<translation type="unfinished">envió un video</translation>
</message>
<message>
<source>sent a video</source>
<translation type="unfinished">envió un video</translation>
</message>
<message>
<source>sent an animation</source>
<comment>myself</comment>
<translation type="unfinished">envió una animación</translation>
</message>
<message>
<source>sent an animation</source>
<translation type="unfinished">envió una animación</translation>
</message>
<message>
<source>sent a voice note</source>
<translation type="unfinished">envió una nota de voz</translation>
</message>
<message>
<source>sent a document</source>
<comment>myself</comment>
<translation type="unfinished">envió un documento</translation>
</message>
<message>
<source>sent a document</source>
<translation type="unfinished">envió un documento</translation>
</message>
<message>
<source>sent a location</source>
<comment>myself</comment>
<translation type="unfinished">envió una ubicación</translation>
</message>
<message>
<source>sent a location</source>
<translation type="unfinished">envió una ubicación</translation>
</message>
<message>
<source>have registered with Telegram</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation type="unfinished">te has registrado en Telegram</translation>
</message>
<message>
<source>joined this chat</source>
<comment>myself</comment>
<translation type="unfinished">se unió a esta charla</translation>
</message>
<message>
<source>joined this chat</source>
<translation type="unfinished">se unió a esta charla</translation>
</message>
<message>
<source>were added to this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>was added to this chat</source>
<translation type="unfinished">se añadió a esta charla</translation>
</message>
<message>
<source>left this chat</source>
<comment>myself</comment>
<translation type="unfinished">dejó esta charla</translation>
</message>
<message>
<source>left this chat</source>
<translation type="unfinished">dejó esta charla</translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation type="unfinished">Mensaje no soportado: %1</translation>
</message>
<message>
<source>Sticker: %1</source>
<translation type="unfinished">Pegatina: %1</translation>
</message>
<message>
<source>sent a voice note</source>
<comment>myself</comment>
<translation type="unfinished">envió una nota de voz</translation>
</message>
<message>
<source>sent a venue</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>ImagePage</name> <name>ImagePage</name>
<message> <message>
@ -322,50 +432,6 @@
<source>%1 unread messages</source> <source>%1 unread messages</source>
<translation>%1 mensajes no leídos</translation> <translation>%1 mensajes no leídos</translation>
</message> </message>
<message>
<source>sent a picture</source>
<translation>envió una imagen</translation>
</message>
<message>
<source>sent a video</source>
<translation>envió un video</translation>
</message>
<message>
<source>sent an animation</source>
<translation>envió una animación</translation>
</message>
<message>
<source>sent a voice note</source>
<translation>envió una nota de voz</translation>
</message>
<message>
<source>sent a document</source>
<translation>envió un documento</translation>
</message>
<message>
<source>sent a location</source>
<translation>envió una ubicación</translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation>te has registrado en Telegram</translation>
</message>
<message>
<source>joined this chat</source>
<translation>se unió a esta charla</translation>
</message>
<message>
<source>was added to this chat</source>
<translation>se añadió a esta charla</translation>
</message>
<message>
<source>left this chat</source>
<translation>dejó esta charla</translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation>Mensaje no soportado: %1</translation>
</message>
</context> </context>
<context> <context>
<name>OverviewPage</name> <name>OverviewPage</name>

View file

@ -228,6 +228,116 @@
<translation>Dokumentum megyitása</translation> <translation>Dokumentum megyitása</translation>
</message> </message>
</context> </context>
<context>
<name>FernschreiberUtils</name>
<message>
<source>sent a picture</source>
<comment>myself</comment>
<translation type="unfinished">képet küldött</translation>
</message>
<message>
<source>sent a picture</source>
<translation type="unfinished">képet küldött</translation>
</message>
<message>
<source>sent a video</source>
<comment>myself</comment>
<translation type="unfinished">videót küldött</translation>
</message>
<message>
<source>sent a video</source>
<translation type="unfinished">videót küldött</translation>
</message>
<message>
<source>sent an animation</source>
<comment>myself</comment>
<translation type="unfinished">animációt küldött</translation>
</message>
<message>
<source>sent an animation</source>
<translation type="unfinished">animációt küldött</translation>
</message>
<message>
<source>sent a voice note</source>
<translation type="unfinished">hangüzenetet küldött</translation>
</message>
<message>
<source>sent a document</source>
<comment>myself</comment>
<translation type="unfinished">dokumentumot küldött</translation>
</message>
<message>
<source>sent a document</source>
<translation type="unfinished">dokumentumot küldött</translation>
</message>
<message>
<source>sent a location</source>
<comment>myself</comment>
<translation type="unfinished">helyzetmeghatározó információt küldött</translation>
</message>
<message>
<source>sent a location</source>
<translation type="unfinished">helyzetmeghatározó információt küldött</translation>
</message>
<message>
<source>have registered with Telegram</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation type="unfinished">regisztrált a Telegram-al</translation>
</message>
<message>
<source>joined this chat</source>
<comment>myself</comment>
<translation type="unfinished">csatlakozott a csevegéshez</translation>
</message>
<message>
<source>joined this chat</source>
<translation type="unfinished">csatlakozott a csevegéshez</translation>
</message>
<message>
<source>were added to this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>was added to this chat</source>
<translation type="unfinished">hozzáadva a csevegéshez</translation>
</message>
<message>
<source>left this chat</source>
<comment>myself</comment>
<translation type="unfinished">kilépett a csevegésből</translation>
</message>
<message>
<source>left this chat</source>
<translation type="unfinished">kilépett a csevegésből</translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation type="unfinished">Nem támogatott üzenet: %1</translation>
</message>
<message>
<source>Sticker: %1</source>
<translation type="unfinished">Matrica: %1</translation>
</message>
<message>
<source>sent a voice note</source>
<comment>myself</comment>
<translation type="unfinished">hangüzenetet küldött</translation>
</message>
<message>
<source>sent a venue</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>ImagePage</name> <name>ImagePage</name>
<message> <message>
@ -322,50 +432,6 @@
<source>%1 unread messages</source> <source>%1 unread messages</source>
<translation>%1 olvasatlan üzenet</translation> <translation>%1 olvasatlan üzenet</translation>
</message> </message>
<message>
<source>sent a picture</source>
<translation>képet küldött</translation>
</message>
<message>
<source>sent a video</source>
<translation>videót küldött</translation>
</message>
<message>
<source>sent an animation</source>
<translation>animációt küldött</translation>
</message>
<message>
<source>sent a voice note</source>
<translation>hangüzenetet küldött</translation>
</message>
<message>
<source>sent a document</source>
<translation>dokumentumok küldött</translation>
</message>
<message>
<source>sent a location</source>
<translation>helyzetmeghatározó információt küldött</translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation>regisztrált a Telegram-al</translation>
</message>
<message>
<source>joined this chat</source>
<translation>csatlakozott a csevegéshez</translation>
</message>
<message>
<source>was added to this chat</source>
<translation>hozzáadva a csevegéshez</translation>
</message>
<message>
<source>left this chat</source>
<translation>kilépett a csevegésből</translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation>Nem támogatott üzenet: %1</translation>
</message>
</context> </context>
<context> <context>
<name>OverviewPage</name> <name>OverviewPage</name>
@ -574,7 +640,7 @@
<message> <message>
<source>sent a document</source> <source>sent a document</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation type="unfinished">dokumentumot küldött</translation>
</message> </message>
<message> <message>
<source>sent a location</source> <source>sent a location</source>

View file

@ -228,6 +228,116 @@
<translation>Otwórz dokument</translation> <translation>Otwórz dokument</translation>
</message> </message>
</context> </context>
<context>
<name>FernschreiberUtils</name>
<message>
<source>sent a picture</source>
<comment>myself</comment>
<translation type="unfinished">wyślij obraz</translation>
</message>
<message>
<source>sent a picture</source>
<translation type="unfinished">wyślij obraz</translation>
</message>
<message>
<source>sent a video</source>
<comment>myself</comment>
<translation type="unfinished">wyślij film</translation>
</message>
<message>
<source>sent a video</source>
<translation type="unfinished">wyślij film</translation>
</message>
<message>
<source>sent an animation</source>
<comment>myself</comment>
<translation type="unfinished">wyślij animację</translation>
</message>
<message>
<source>sent an animation</source>
<translation type="unfinished">wyślij animację</translation>
</message>
<message>
<source>sent a voice note</source>
<translation type="unfinished">wyślij notatke głosową</translation>
</message>
<message>
<source>sent a document</source>
<comment>myself</comment>
<translation type="unfinished">wyślij dokument</translation>
</message>
<message>
<source>sent a document</source>
<translation type="unfinished">wyślij dokument</translation>
</message>
<message>
<source>sent a location</source>
<comment>myself</comment>
<translation type="unfinished">wyślij lokalizację</translation>
</message>
<message>
<source>sent a location</source>
<translation type="unfinished">wyślij lokalizację</translation>
</message>
<message>
<source>have registered with Telegram</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation type="unfinished">zarejestrował się w Telegramie</translation>
</message>
<message>
<source>joined this chat</source>
<comment>myself</comment>
<translation type="unfinished">dołaczył do tego czatu</translation>
</message>
<message>
<source>joined this chat</source>
<translation type="unfinished">dołaczył do tego czatu</translation>
</message>
<message>
<source>were added to this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>was added to this chat</source>
<translation type="unfinished">został dodany do tego czatu</translation>
</message>
<message>
<source>left this chat</source>
<comment>myself</comment>
<translation type="unfinished">opuścił ten czat</translation>
</message>
<message>
<source>left this chat</source>
<translation type="unfinished">opuścił ten czat</translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation type="unfinished">Nieobsługiwana wiadomość: %1</translation>
</message>
<message>
<source>Sticker: %1</source>
<translation type="unfinished">Naklejka: %1</translation>
</message>
<message>
<source>sent a voice note</source>
<comment>myself</comment>
<translation type="unfinished">wyślij notatke głosową</translation>
</message>
<message>
<source>sent a venue</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>ImagePage</name> <name>ImagePage</name>
<message> <message>
@ -322,50 +432,6 @@
<source>%1 unread messages</source> <source>%1 unread messages</source>
<translation>%1 nieprzeczytanych wiadomości</translation> <translation>%1 nieprzeczytanych wiadomości</translation>
</message> </message>
<message>
<source>sent a picture</source>
<translation>wyślij obraz</translation>
</message>
<message>
<source>sent a video</source>
<translation>wyślij film</translation>
</message>
<message>
<source>sent an animation</source>
<translation>wyślij animację</translation>
</message>
<message>
<source>sent a voice note</source>
<translation>wyślij notatke głosową</translation>
</message>
<message>
<source>sent a document</source>
<translation>wyślij dokument</translation>
</message>
<message>
<source>sent a location</source>
<translation>wyślij lokalizację</translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation>zarejestrował się w Telegramie</translation>
</message>
<message>
<source>joined this chat</source>
<translation>dołączył do tego czatu</translation>
</message>
<message>
<source>was added to this chat</source>
<translation>został dodany do tego czatu</translation>
</message>
<message>
<source>left this chat</source>
<translation>opuścil ten czat</translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation>Nieobsługiwana wiadomość: %1</translation>
</message>
</context> </context>
<context> <context>
<name>OverviewPage</name> <name>OverviewPage</name>
@ -593,7 +659,7 @@
<message> <message>
<source>joined this chat</source> <source>joined this chat</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation type="unfinished">dołaczył do tego czatu</translation>
</message> </message>
<message> <message>
<source>were added to this chat</source> <source>were added to this chat</source>
@ -603,7 +669,7 @@
<message> <message>
<source>left this chat</source> <source>left this chat</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation type="unfinished">opuścił ten czat</translation>
</message> </message>
</context> </context>
</TS> </TS>

View file

@ -73,7 +73,7 @@
</message> </message>
<message> <message>
<source>By Sebastian J. Wolf and &lt;a href=&quot;https://github.com/Wunderfitz/harbour-fernschreiber#contributions&quot;&gt;other contributors&lt;/a&gt;</source> <source>By Sebastian J. Wolf and &lt;a href=&quot;https://github.com/Wunderfitz/harbour-fernschreiber#contributions&quot;&gt;other contributors&lt;/a&gt;</source>
<translation type="unfinished"></translation> <translation> Sebastian J. Wolf &lt;ahref=&quot;https://github.com/Wunderfitz/harbour-fernschreiber#contributions&quot;&gt;其他贡献者&lt;/a&gt;</translation>
</message> </message>
</context> </context>
<context> <context>
@ -131,7 +131,7 @@
</message> </message>
<message> <message>
<source>%1 subscribers</source> <source>%1 subscribers</source>
<translation>%1 </translation> <translation>%1 </translation>
</message> </message>
<message> <message>
<source>Reply to Message</source> <source>Reply to Message</source>
@ -171,7 +171,7 @@
</message> </message>
<message> <message>
<source>Uploading...</source> <source>Uploading...</source>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
</context> </context>
<context> <context>
@ -228,6 +228,116 @@
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context>
<name>FernschreiberUtils</name>
<message>
<source>sent a picture</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a picture</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a video</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a video</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent an animation</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent an animation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a voice note</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a document</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a location</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a location</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>have registered with Telegram</source>
<comment>myself</comment>
<translation type="unfinished"> Telegram</translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation type="unfinished"> Telegram </translation>
</message>
<message>
<source>joined this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>joined this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>were added to this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>was added to this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>left this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>left this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation type="unfinished">: %1</translation>
</message>
<message>
<source>Sticker: %1</source>
<translation type="unfinished">: %1</translation>
</message>
<message>
<source>sent a voice note</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a venue</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>ImagePage</name> <name>ImagePage</name>
<message> <message>
@ -247,7 +357,7 @@
<name>InReplyToRow</name> <name>InReplyToRow</name>
<message> <message>
<source>You</source> <source>You</source>
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context> <context>
@ -274,7 +384,7 @@
</message> </message>
<message> <message>
<source>Loading...</source> <source>Loading...</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<source>Unable to authenticate you with the entered code.</source> <source>Unable to authenticate you with the entered code.</source>
@ -313,58 +423,14 @@
<name>LocationPreview</name> <name>LocationPreview</name>
<message> <message>
<source>Install Pure Maps to inspect this location.</source> <source>Install Pure Maps to inspect this location.</source>
<translation type="unfinished"></translation> <translation> Pure Maps </translation>
</message> </message>
</context> </context>
<context> <context>
<name>NotificationManager</name> <name>NotificationManager</name>
<message> <message>
<source>%1 unread messages</source> <source>%1 unread messages</source>
<translation>%1 </translation> <translation>%1 </translation>
</message>
<message>
<source>sent a picture</source>
<translation></translation>
</message>
<message>
<source>sent a video</source>
<translation></translation>
</message>
<message>
<source>sent an animation</source>
<translation></translation>
</message>
<message>
<source>sent a voice note</source>
<translation></translation>
</message>
<message>
<source>sent a document</source>
<translation></translation>
</message>
<message>
<source>sent a location</source>
<translation></translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation> Telegram </translation>
</message>
<message>
<source>joined this chat</source>
<translation></translation>
</message>
<message>
<source>was added to this chat</source>
<translation></translation>
</message>
<message>
<source>left this chat</source>
<translation></translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation> %1</translation>
</message> </message>
</context> </context>
<context> <context>
@ -488,7 +554,7 @@
</message> </message>
<message> <message>
<source>Unsupported message: %1</source> <source>Unsupported message: %1</source>
<translation>t: %1</translation> <translation>: %1</translation>
</message> </message>
<message> <message>
<source>Document: %1</source> <source>Document: %1</source>
@ -544,66 +610,66 @@
</message> </message>
<message> <message>
<source>sent a venue</source> <source>sent a venue</source>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>sent a picture</source> <source>sent a picture</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>sent a video</source> <source>sent a video</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>sent an animation</source> <source>sent an animation</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>sent an audio</source> <source>sent an audio</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>sent a voice note</source> <source>sent a voice note</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>sent a document</source> <source>sent a document</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>sent a location</source> <source>sent a location</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>sent a venue</source> <source>sent a venue</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>have registered with Telegram</source> <source>have registered with Telegram</source>
<translation type="unfinished"></translation> <translation> Telegram</translation>
</message> </message>
<message> <message>
<source>joined this chat</source> <source>joined this chat</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>were added to this chat</source> <source>were added to this chat</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>left this chat</source> <source>left this chat</source>
<comment>myself</comment> <comment>myself</comment>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
</context> </context>
</TS> </TS>

View file

@ -228,6 +228,132 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>FernschreiberUtils</name>
<message>
<source>sent a picture</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a picture</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a video</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a video</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent an animation</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent an animation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a voice note</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a document</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a location</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a location</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>have registered with Telegram</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>joined this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>joined this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>were added to this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>was added to this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>left this chat</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>left this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sticker: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a voice note</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a venue</source>
<comment>myself</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a venue</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Register User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter your First Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter your Last Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User Registration</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>ImagePage</name> <name>ImagePage</name>
<message> <message>
@ -292,22 +418,6 @@
<source>Please enter your password:</source> <source>Please enter your password:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Register User</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter your First Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enter your Last Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>User Registration</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>LocationPreview</name> <name>LocationPreview</name>
@ -322,50 +432,6 @@
<source>%1 unread messages</source> <source>%1 unread messages</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>sent a picture</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a video</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent an animation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a voice note</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>sent a location</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>has registered with Telegram</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>joined this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>was added to this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>left this chat</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Unsupported message: %1</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>OverviewPage</name> <name>OverviewPage</name>