{"action":"created","issue":{"url":"https://api.github.com/repos/friendica/friendica/issues/2813","repository_url":"https://api.github.com/repos/friendica/friendica","labels_url":"https://api.github.com/repos/friendica/friendica/issues/2813/labels{/name}","comments_url":"https://api.github.com/repos/friendica/friendica/issues/2813/comments","events_url":"https://api.github.com/repos/friendica/friendica/issues/2813/events","html_url":"https://github.com/friendica/friendica/issues/2813","id":179945255,"number":2813,"title":"Double notification + wrong message for requested registrations","user":{"login":"Hypolite","id":925415,"avatar_url":"https://avatars.githubusercontent.com/u/925415?v=3","gravatar_id":"","url":"https://api.github.com/users/Hypolite","html_url":"https://github.com/Hypolite","followers_url":"https://api.github.com/users/Hypolite/followers","following_url":"https://api.github.com/users/Hypolite/following{/other_user}","gists_url":"https://api.github.com/users/Hypolite/gists{/gist_id}","starred_url":"https://api.github.com/users/Hypolite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hypolite/subscriptions","organizations_url":"https://api.github.com/users/Hypolite/orgs","repos_url":"https://api.github.com/users/Hypolite/repos","events_url":"https://api.github.com/users/Hypolite/events{/privacy}","received_events_url":"https://api.github.com/users/Hypolite/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-09-29T03:37:17Z","updated_at":"2016-10-01T13:44:33Z","closed_at":"2016-10-01T13:44:33Z","body":"I tried to create a test account to verify my work on #2804, but then I stumbled on this multipronged issue regarding registration requests in notifications:\r\n\r\n![friendica_registration_request_notification_issue](https://cloud.githubusercontent.com/assets/925415/18939630/848d58b2-85cf-11e6-864d-98b8589ae65b.png)\r\n\r\nPlease disregard the language discrepancy, it's already being address by #2752.\r\n\r\nThere are two notifications for a single registration request, one of them being badly formatted. I dug the `ping.php` code a little, and here's what I found:\r\n- The first notification is stored in the DB with an already translated message that end up being mangled since the contact name is forcefully prepended to the message that misses the expected contact mention at the end\r\n- The second notification is created out of the actual registration requests\r\n\r\nI was able to fix the first notification display, but by doing so I went back on changes introduced in the vier and frio theme. The typical notification template is the following:\r\n\r\n    <li class=\"{4}\">\r\n        <a href=\"{0}\"><img data-src=\"{1}\" height=\"24\" width=\"24\" alt=\"\" />{2} <span class=\"notif-when\">{3}</span></a>\r\n    </li>\r\n\r\nvier and frio themes have the fancier one: \r\n\r\n    <li class=\"{4} notif-entry\" onclick=\"location.href='{0}';\">\r\n\t\t<div class=\"notif-entry-wrapper media\">\r\n\t\t\t<div class=\"notif-photo-wrapper media-object pull-left\"><a href=\"{6}\"><img data-src=\"{1}\"></a></div>\r\n\t\t\t<div class=\"notif-desc-wrapper media-body\">\r\n\t\t\t\t{8}{7}\r\n\t\t\t\t<div><time class=\"notif-when time\" data-toggle=\"tooltip\" title=\"{5}\">{3}</time></div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n    </li>\r\n\r\nThe placeholders are described in `main.js:265`:\r\n\r\n- {0}  // link to the source\r\n- {1}  // photo of the contact\r\n- {2}  // preformatet text (autor + text)\r\n- {3}  // date of notification (time ago)\r\n- {4}  // vistiting status of the notification\r\n- {5}  //date of notification\r\n- {6}  // profile url of the contact\r\n- {7}  // clean status text\r\n- {8}  //preformatat author (name + profile url)\r\n\r\nNow, the problem is that the contact name is stripped from {7}, and then prepended by {8}{7}. But not all translated messages expect the contact name in the front. For example in french, for the registration request message, the contact name is at the end. And that's exactly what is already in {3}, used by previous templates.\r\n\r\nMy questions then are:\r\n- Why switch from {3} to {8}{7}? Is there a specific reason I can't possible deduce from the code?\r\n- Why not go back to {3} since fixing {8}{7} produce exactly the same result?\r\n- Why two different notifications for registration requests? Is it an artifact of a legacy system?\r\n- If yes, which way is the \"canon\"?"},"comment":{"url":"https://api.github.com/repos/friendica/friendica/issues/comments/250913210","html_url":"https://github.com/friendica/friendica/issues/2813#issuecomment-250913210","issue_url":"https://api.github.com/repos/friendica/friendica/issues/2813","id":250913210,"user":{"login":"Hypolite","id":925415,"avatar_url":"https://avatars.githubusercontent.com/u/925415?v=3","gravatar_id":"","url":"https://api.github.com/users/Hypolite","html_url":"https://github.com/Hypolite","followers_url":"https://api.github.com/users/Hypolite/followers","following_url":"https://api.github.com/users/Hypolite/following{/other_user}","gists_url":"https://api.github.com/users/Hypolite/gists{/gist_id}","starred_url":"https://api.github.com/users/Hypolite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hypolite/subscriptions","organizations_url":"https://api.github.com/users/Hypolite/orgs","repos_url":"https://api.github.com/users/Hypolite/repos","events_url":"https://api.github.com/users/Hypolite/events{/privacy}","received_events_url":"https://api.github.com/users/Hypolite/received_events","type":"User","site_admin":false},"created_at":"2016-10-01T13:44:33Z","updated_at":"2016-10-01T13:44:33Z","body":"> I think that there are two classes of notifications: The one that are only notifications that something is happened. And the other one that request an action. These should stay unseen until the action was done.\r\n\r\nIt makes perfect sense and I'll leave it like that. On Facebook the \"action required\" notifications (the contact request) are in a separate page but it's the same principle, it doesn't go away until you actually do something. I don't think that those notifications should then linger because an action has been taken and following the notification link again would not be useful any more since the item would have disappeared (either registration request or contact request)\r\n\r\n> This means that you could have 20 seen notifications and the 21st position is an unseen one. When you work at this place, could you fix this as well?\r\n\r\nI don't see a problem with that, notifications are ordered by time and I don't think it should be any different. We already show the 50 latest notifications in the dropdown, which should be ample enough not to miss anything, but should you, there's the notification page for you.\r\n\r\nI'm perfectly happy with the current state of the notifications and I won't tinker with it anymore unless something really wrong shows up."}}
{"actor":{"display_login":"Hypolite"}}