Merge pull request 'origin_merged' (#8) from sprainbrains/harbour-fernschreiber:origin_merged into master
Reviewed-on: medvedych/harbour-fernschreiber#8
This commit is contained in:
commit
400cda8dcd
15 changed files with 14 additions and 96 deletions
|
@ -561,6 +561,15 @@ int ChatListModel::updateChatOrder(int chatIndex)
|
||||||
return newIndex;
|
return newIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChatListModel::enableRefreshTimer()
|
||||||
|
{
|
||||||
|
// Start timestamp refresh timer if not yet active (usually when the first visible chat is discovered)
|
||||||
|
if (!relativeTimeRefreshTimer->isActive()) {
|
||||||
|
LOG("Enabling refresh timer");
|
||||||
|
relativeTimeRefreshTimer->start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ChatListModel::calculateUnreadState()
|
void ChatListModel::calculateUnreadState()
|
||||||
{
|
{
|
||||||
if (this->appSettings->onlineOnlyMode()) {
|
if (this->appSettings->onlineOnlyMode()) {
|
||||||
|
@ -599,6 +608,7 @@ void ChatListModel::addVisibleChat(ChatData *chat)
|
||||||
this->tdLibWrapper->registerJoinChat();
|
this->tdLibWrapper->registerJoinChat();
|
||||||
emit chatJoined(chat->chatId, chat->chatData.value("title").toString());
|
emit chatJoined(chat->chatId, chat->chatData.value("title").toString());
|
||||||
}
|
}
|
||||||
|
enableRefreshTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatListModel::updateChatVisibility(const TDLibWrapper::Group *group)
|
void ChatListModel::updateChatVisibility(const TDLibWrapper::Group *group)
|
||||||
|
@ -687,6 +697,7 @@ void ChatListModel::setShowAllChats(bool showAll)
|
||||||
|
|
||||||
void ChatListModel::handleChatDiscovered(const QString &, const QVariantMap &chatToBeAdded)
|
void ChatListModel::handleChatDiscovered(const QString &, const QVariantMap &chatToBeAdded)
|
||||||
{
|
{
|
||||||
|
LOG("New chat discovered");
|
||||||
ChatData *chat = new ChatData(tdLibWrapper, chatToBeAdded);
|
ChatData *chat = new ChatData(tdLibWrapper, chatToBeAdded);
|
||||||
|
|
||||||
const TDLibWrapper::Group *group = tdLibWrapper->getGroup(chat->groupId);
|
const TDLibWrapper::Group *group = tdLibWrapper->getGroup(chat->groupId);
|
||||||
|
@ -705,12 +716,8 @@ void ChatListModel::handleChatDiscovered(const QString &, const QVariantMap &cha
|
||||||
LOG("Hidden chat" << chat->chatId);
|
LOG("Hidden chat" << chat->chatId);
|
||||||
hiddenChats.insert(chat->chatId, chat);
|
hiddenChats.insert(chat->chatId, chat);
|
||||||
} else {
|
} else {
|
||||||
|
LOG("Visible chat" << chat->chatId);
|
||||||
addVisibleChat(chat);
|
addVisibleChat(chat);
|
||||||
|
|
||||||
// Start timestamp refresh timer when the first visible chat is discovered
|
|
||||||
if (!relativeTimeRefreshTimer->isActive()) {
|
|
||||||
relativeTimeRefreshTimer->start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1034,5 +1041,6 @@ void ChatListModel::handleRelativeTimeRefreshTimer()
|
||||||
LOG("Refreshing timestamps");
|
LOG("Refreshing timestamps");
|
||||||
QVector<int> roles;
|
QVector<int> roles;
|
||||||
roles.append(ChatListModel::RoleLastMessageDate);
|
roles.append(ChatListModel::RoleLastMessageDate);
|
||||||
|
roles.append(ChatListModel::RoleLastMessageStatus);
|
||||||
emit dataChanged(index(0), index(chatList.size() - 1), roles);
|
emit dataChanged(index(0), index(chatList.size() - 1), roles);
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,6 +108,7 @@ private:
|
||||||
void updateChatVisibility(const TDLibWrapper::Group *group);
|
void updateChatVisibility(const TDLibWrapper::Group *group);
|
||||||
void updateSecretChatVisibility(const QVariantMap secretChatDetails);
|
void updateSecretChatVisibility(const QVariantMap secretChatDetails);
|
||||||
int updateChatOrder(int chatIndex);
|
int updateChatOrder(int chatIndex);
|
||||||
|
void enableRefreshTimer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TDLibWrapper *tdLibWrapper;
|
TDLibWrapper *tdLibWrapper;
|
||||||
|
|
|
@ -495,13 +495,6 @@
|
||||||
<translation>Sie haben noch keine Chats.</translation>
|
<translation>Sie haben noch keine Chats.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation>Konnte Ihre Kontakte nicht mit Telegram synchronisieren.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -495,13 +495,6 @@
|
||||||
<translation>You don't have any chats yet.</translation>
|
<translation>You don't have any chats yet.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation type="unfinished">Could not synchronize your contacts with Telegram.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -495,13 +495,6 @@
|
||||||
<translation>No hay todavía conversaciones.</translation>
|
<translation>No hay todavía conversaciones.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation>No se puede sincronizar los contactos con Telegrama.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -495,13 +495,6 @@
|
||||||
<translation>Sinulla ei ole vielä keskusteluja.</translation>
|
<translation>Sinulla ei ole vielä keskusteluja.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation type="unfinished">Yhteystietojasi ei voitu synkronoida Telegramin kanssa.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -495,13 +495,6 @@
|
||||||
<translation>Vous n'avez aucune conversation.</translation>
|
<translation>Vous n'avez aucune conversation.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation>Impossible de synchroniser vos contacts avec Telegram.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -485,13 +485,6 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -495,13 +495,6 @@
|
||||||
<translation>Nessuna chat presente</translation>
|
<translation>Nessuna chat presente</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation type="unfinished">Sincronizzazione contatti con Telegram non riuscita</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -505,13 +505,6 @@
|
||||||
<translation>Nie masz jeszcze żadnych czatów.</translation>
|
<translation>Nie masz jeszcze żadnych czatów.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation>Nie można zsynchonizaować kontaktów z Telegramem.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -505,13 +505,6 @@
|
||||||
<translation>Тут пока ничего нет</translation>
|
<translation>Тут пока ничего нет</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation>Невозможно синхронизировать ваши контакты с Телеграм.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -505,13 +505,6 @@
|
||||||
<translation>Nemáte žiadne čety.</translation>
|
<translation>Nemáte žiadne čety.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation>Nemožno synchonizovať kontakty s Telegramom.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -495,13 +495,6 @@
|
||||||
<translation>Du har inga chattar än.</translation>
|
<translation>Du har inga chattar än.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation>Kunde inte synkronisera dina kontakter med Telegram.</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -485,13 +485,6 @@
|
||||||
<translation>你还没有任何对话。</translation>
|
<translation>你还没有任何对话。</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation type="unfinished">无法同步你的云端 Telegram 联系人。</translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
|
@ -495,13 +495,6 @@
|
||||||
<translation>You don't have any chats yet.</translation>
|
<translation>You don't have any chats yet.</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
|
||||||
<name>ContactSync</name>
|
|
||||||
<message>
|
|
||||||
<source>Could not synchronize your contacts with Telegram.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
</context>
|
|
||||||
<context>
|
<context>
|
||||||
<name>CoverPage</name>
|
<name>CoverPage</name>
|
||||||
<message>
|
<message>
|
||||||
|
|
Loading…
Reference in a new issue