Skip to content

Commit

Permalink
More detailed notification message
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Jan 10, 2025
1 parent 76946f2 commit e4acdc7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
6 changes: 5 additions & 1 deletion daemon/blockcontroler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,21 @@ void BlockControler::incomingCall(const QString &_callerId, const QString &calle

bool isHiddenNumber = (callerId == "x-ofono-unknown");
if (isHiddenNumber && ExphoneConfig::instance()->blockingCLIR()) {
//: Anonymous caller refers to CLIR/x-ofono-unknown
showNotification(tr("Anonymous caller"), QString());
blocked = true;
}

bool isUnknown = (callerId == callerName);
if (isUnknown && ExphoneConfig::instance()->blockingUnknown()) {
//: Unknown caller means caller which is not present in contact list
showNotification(callerId, tr("Unknown caller"));
blocked = true;
}

if (!blocked) {
blocked = m_blockModel.isBlocked(callerId);
showNotification(callerId, callerName);
}

m_blockModel.logCall(callerId, callerName);
Expand All @@ -56,7 +61,6 @@ void BlockControler::incomingCall(const QString &_callerId, const QString &calle
#if defined(MER_EDITION_SAILFISH) || defined(UUITK_EDITION)
m_voiceCallController.hangup();
#endif
showNotification(callerId, callerName);
}
}

Expand Down
24 changes: 19 additions & 5 deletions daemon/translations/exphoned.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="en">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en">
<context>
<name>BlockControler</name>
<message>
<location filename="../blockcontroler.cpp" line="72"/>
<location filename="../blockcontroler.cpp" line="42"/>
<source>Anonymous caller</source>
<extracomment>Anonymous caller refers to CLIR/x-ofono-unknown</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockcontroler.cpp" line="49"/>
<source>Unknown caller</source>
<extracomment>Unknown caller means caller which is not present in contact list</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../blockcontroler.cpp" line="74"/>
<source>%1</source>
<extracomment>phone number in notification body formatted as &quot;%s&quot;</extracomment>
<translation>%1</translation>
</message>
<message>
<location filename="../blockcontroler.cpp" line="75"/>
<location filename="../blockcontroler.cpp" line="77"/>
<source>%1 (%2)</source>
<extracomment>phone number and contact name formatted as &quot;%s (%s)&quot;</extracomment>
<translation>%1 (%2)</translation>
Expand All @@ -17,9 +31,9 @@
<context>
<name>QObject</name>
<message>
<location filename="../blockcontroler.cpp" line="68"/>
<location filename="../blockcontroler.cpp" line="70"/>
<source>Phone call was blocked</source>
<translation>Phone call was blocked</translation>
</message>
</context>
</TS>
</TS>

0 comments on commit e4acdc7

Please sign in to comment.