Commit c01db099 authored by pvuorela's avatar pvuorela

Merge branch 'non_critical_notifications' into 'master'

[commhistoryd] Replace critical urgency with display on hint. Contributes to JB#50221

See merge request !42
parents 77dd5f88 093ee948
app_icon=icon-lock-missed-call
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=call_exists
app_icon=icon-lock-missed-call
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=call_exists
app_icon=icon-lock-information
urgency=2
x-nemo-display-on=true
transient=true
app_icon=icon-lock-information
urgency=2
x-nemo-display-on=true
transient=true
x-nemo-feedback=warning_strong
app_icon=icon-lock-sms
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms_exists
app_icon=icon-lock-sms
transient=true
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms
x-nemo-display-on=true
app_icon=icon-lock-sms
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=chat_exists
app_icon=icon-lock-sms
transient=true
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=chat
x-nemo-display-on=true
app_icon=icon-lock-sms
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms_exists
app_icon=icon-lock-sms
transient=true
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms
x-nemo-display-on=true
app_icon=icon-lock-sms
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms_exists
app_icon=icon-lock-sms
transient=true
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms
x-nemo-display-on=true
app_icon=icon-lock-sms
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms_exists
app_icon=icon-lock-sms
transient=true
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms
x-nemo-display-on=true
app_icon=icon-lock-voicemail
urgency=2
x-nemo-display-on=true
x-nemo-user-removable=false
x-nemo-priority=120
x-nemo-feedback=sms_exists
app_icon=icon-lock-voicemail
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-user-removable=false
x-nemo-feedback=sms_exists
app_icon=icon-lock-voicemail
transient=true
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms
x-nemo-display-on=true
app_icon=icon-lock-voicemail
transient=true
urgency=2
x-nemo-display-on=true
x-nemo-priority=120
x-nemo-feedback=sms
x-nemo-display-on=true
......@@ -24,10 +24,6 @@
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include <CommHistory/Event>
namespace RTComLogger {
// Used to generate duiremoteaction strings
#define OBJECT_PATH QLatin1String("/")
......@@ -96,30 +92,4 @@ namespace RTComLogger {
#define VOICEMAIL_CONTACT_VMID_DIR QLatin1String("contacts")
#define VOICEMAIL_CONTACT_VMID_FILE QLatin1String("vmid")
// events
struct EventTypes {
int type;
const char* event;
};
static const EventTypes _eventTypes[] =
{
{CommHistory::Event::IMEvent, "x-nemo.messaging.im"},
{CommHistory::Event::SMSEvent, "x-nemo.messaging.sms"},
{CommHistory::Event::MMSEvent, "x-nemo.messaging.mms"},
{CommHistory::Event::CallEvent, "x-nemo.call.missed"},
{CommHistory::Event::VoicemailEvent,"x-nemo.messaging.voicemail"},
{VOICEMAIL_SMS_EVENT_TYPE, "x-nemo.messaging.voicemail-SMS"}
};
static const int _eventTypesCount = sizeof(_eventTypes) / sizeof(EventTypes);
// Custom system info notification types for commhistoryd:
const QString ErrorCategory = "x-nemo.messaging.error";
const QString StrongErrorCategory = "x-nemo.messaging.error.strong";
const QString voicemailWaitingCategory = "x-nemo.messaging.voicemail-waiting";
}
#endif //#define CONSTANTS_H
......@@ -58,6 +58,7 @@ NotificationManager* NotificationManager::m_pInstance = 0;
static const QString NgfdEventSms("sms");
static const QString NgfdEventChat("chat");
static const QString voicemailWaitingCategory = "x-nemo.messaging.voicemail-waiting";
// constructor
//
......
......@@ -33,6 +33,24 @@
using namespace RTComLogger;
using namespace CommHistory;
// events
struct EventTypes {
int type;
const char* event;
};
static const EventTypes _eventTypes[] =
{
{CommHistory::Event::IMEvent, "x-nemo.messaging.im"},
{CommHistory::Event::SMSEvent, "x-nemo.messaging.sms"},
{CommHistory::Event::MMSEvent, "x-nemo.messaging.mms"},
{CommHistory::Event::CallEvent, "x-nemo.call.missed"},
{CommHistory::Event::VoicemailEvent,"x-nemo.messaging.voicemail"},
{VOICEMAIL_SMS_EVENT_TYPE, "x-nemo.messaging.voicemail-SMS"}
};
static const int _eventTypesCount = sizeof(_eventTypes) / sizeof(EventTypes);
static QString groupType(int eventType)
{
for (int i = 0; i < _eventTypesCount; i++) {
......
......@@ -116,6 +116,8 @@ QTCONTACTS_USE_NAMESPACE
QTVERSIT_USE_NAMESPACE
namespace {
const QString ErrorCategory = "x-nemo.messaging.error";
const QString StrongErrorCategory = "x-nemo.messaging.error.strong";
CommHistory::Event::PropertySet deliveryHandlingProperties = CommHistory::Event::PropertySet()
<< CommHistory::Event::Id
......@@ -197,6 +199,18 @@ QString subscriberIdentity(const Tp::MessagePart &header)
return partValue<QString>(header, SUBSCRIBER_IDENTITY_HEADER_KEY);
}
void showErrorNote(const QString &errorMsg, const QString &category = ErrorCategory)
{
if (!errorMsg.isEmpty()) {
Notification notification;
notification.setAppName(txt_qtn_msg_errors_group);
notification.setCategory(category);
notification.setBody(errorMsg);
notification.setPreviewBody(errorMsg);
notification.publish();
}
}
} // anonymous namespace
QMultiHash<QString,uint> TextChannelListener::m_pendingMessageIds;
......@@ -1120,18 +1134,6 @@ void TextChannelListener::handleMessageFailed(const Tp::ReceivedMessage &message
}
}
void TextChannelListener::showErrorNote(const QString &errorMsg, const QString &category)
{
if (!errorMsg.isEmpty()) {
Notification notification;
notification.setAppName(txt_qtn_msg_errors_group);
notification.setCategory(category);
notification.setBody(errorMsg);
notification.setPreviewBody(errorMsg);
notification.publish();
}
}
CommHistory::Event::EventType TextChannelListener::eventType() const
{
CommHistory::Event::EventType type = CommHistory::Event::UnknownType;
......
......@@ -146,7 +146,6 @@ private:
void handleMessageFailed(const Tp::ReceivedMessage &message,
const CommHistory::Event &event);
void sendGroupChatEvent(const QString &message);
void showErrorNote(const QString &errorMsg, const QString &category = ErrorCategory);
void updateCurrentGroup(int start, int end, const QModelIndex &parent = QModelIndex());
// attempt to read original message from delivery report
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment