mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Better detection for the mobile client to avoid "{0}" in notifications.
This commit is contained in:
parent
e02546880f
commit
c89c0916e2
3 changed files with 13 additions and 5 deletions
|
@ -316,6 +316,8 @@ function ping_get_notifications($uid, $regularnotifications) {
|
|||
$order = "";
|
||||
$quit = false;
|
||||
|
||||
$a = get_app();
|
||||
|
||||
do {
|
||||
$r = q("SELECT `notify`.*, `item`.`visible`, `item`.`spam`, `item`.`deleted`
|
||||
FROM `notify` LEFT JOIN `item` ON `item`.`id` = `notify`.`iid`
|
||||
|
@ -354,8 +356,9 @@ function ping_get_notifications($uid, $regularnotifications) {
|
|||
// Replace the name with {0} but ensure to make that only once
|
||||
// The {0} is used later and prints the name in bold.
|
||||
// But don't do it for the android app.
|
||||
|
||||
$pos = strpos($notification["msg"],$notification['name']);
|
||||
if (($pos !== false) AND $regularnotifications)
|
||||
if (($pos !== false) AND $regularnotifications AND !$a->is_friendica_app())
|
||||
$notification["msg"] = substr_replace($notification["msg"],"{0}",$pos,strlen($notification["name"]));
|
||||
else
|
||||
$notification["msg"] = str_replace("{0}", $notification["name"], $notification["msg"]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue