Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
Pushhelper: Was generating tons of debug output for nothing
Browse files Browse the repository at this point in the history
New style for the connectro icon: Exclamation mark during network reconnect. Prepare busy property
New property enabled for the channel toolbar
  • Loading branch information
Flohack74 committed Mar 10, 2018
1 parent 4b5fbeb commit b5ec5f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion telegram/app/qml/AccountPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ Page {
extension: profiles.count > 1 ? sections : null
trailingActionBar.actions: Action {
visible: !telegram.connected || !Connectivity.online
iconName: !Connectivity.online? "sync-paused" : !telegram.connected? "sync-updating" : "ok"
iconName: telegram.busy? "sync-updating" : !telegram.connected? "sync-error" : "sync-paused"
}
}

Expand Down
2 changes: 1 addition & 1 deletion telegram/app/qml/AccountSendMessage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Rectangle {
property int dialogId: isChannel ? currentDialog.peer.channelId : isChat ? currentDialog.peer.chatId : currentDialog.peer.userId
property bool isMuted: telegramObject.userData.isMuted(dialogId)

property bool channelToolbar: isChannel && !chat.megaGroup && false //need to replace 'false' with the property saying if you can write messages to the channel or not
property bool channelToolbar: isChannel && !chat.megaGroup && !(chat.isCreator || chat.isEditor || chat.isModerator)

signal accepted( string text, int inReplyTo )
signal copyRequest()
Expand Down
4 changes: 2 additions & 2 deletions telegram/app/qml/components/TelegramHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ PageHeader {
Rectangle {
id: connectingIndicator
anchors.fill: headerImage
visible: isConnecting || !Connectivity.online
visible: isConnecting || !Connectivity.online || telegram.busy
color: "white"
Icon {
name: isConnecting? "sync-updating" : "sync-paused"
name: telegram.busy? "sync-updating" : isConnecting? "sync-error" : "sync-paused"
anchors.fill: parent
}
SequentialAnimation {
Expand Down
5 changes: 5 additions & 0 deletions telegram/push/pushhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ QJsonObject PushHelper::pushToPostalMessage(const QJsonObject &push, QString &ta
if (message.keys().contains("loc_key")) {
key = message["loc_key"].toString(); // no-i18n
}

//Early bail-out: Telegram server just removes notification, message has been read elsewhere
if (key == "")
return QJsonObject();

QJsonArray args;
if (message.keys().contains("loc_args")) {
args = message["loc_args"].toArray(); // no-i18n
Expand Down

0 comments on commit b5ec5f5

Please sign in to comment.