Merge remote-tracking branch 'upstream/develop' into user-contact

This commit is contained in:
Michael 2021-09-26 03:07:59 +00:00
commit a2532ad755
6 changed files with 59 additions and 32 deletions

View File

@ -410,6 +410,7 @@ steps:
- # calculate SHA256 checksum - # calculate SHA256 checksum
- cd ./build - cd ./build
- sha256sum "$ARTIFACT" > "$ARTIFACT.sum256" - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
- chmod 664 ./*
- ls -lh - ls -lh
- # output the sha256 sum for checking - # output the sha256 sum for checking
- cat "$ARTIFACT.sum256" - cat "$ARTIFACT.sum256"
@ -518,6 +519,7 @@ steps:
- # calculate SHA256 checksum - # calculate SHA256 checksum
- cd ./build - cd ./build
- sha256sum "$ARTIFACT" > "$ARTIFACT.sum256" - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256"
- chmod 664 ./*
- ls -lh - ls -lh
- # output the sha256 sum for checking - # output the sha256 sum for checking
- cat "$ARTIFACT.sum256" - cat "$ARTIFACT.sum256"

View File

@ -479,6 +479,23 @@ Hook data:
- **uid** (input): the user to return the contact data for (can be empty for public contacts). - **uid** (input): the user to return the contact data for (can be empty for public contacts).
- **result** (output): Set by the hook function to indicate a successful detection. - **result** (output): Set by the hook function to indicate a successful detection.
### follow
Called before adding a new contact for a user to handle non-native network remote contact (like Twitter).
Hook data:
- **url** (input): URL of the remote contact.
- **contact** (output): should be filled with the contact (with uid = user creating the contact) array if follow was successful.
### unfollow
Called when unfollowing a remote contact on a non-native network (like Twitter)
Hook data:
- **contact** (input): the remote contact (uid = local unfollowing user id) array.
- **dissolve** (input): whether to stop sharing with the remote contact as well.
## Complete list of hook callbacks ## Complete list of hook callbacks
Here is a complete list of all hook callbacks with file locations (as of 24-Sep-2018). Please see the source for details of any hooks not documented above. Here is a complete list of all hook callbacks with file locations (as of 24-Sep-2018). Please see the source for details of any hooks not documented above.
@ -648,6 +665,7 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
Hook::callAll('contact_photo_menu', $args); Hook::callAll('contact_photo_menu', $args);
Hook::callAll('follow', $arr); Hook::callAll('follow', $arr);
Hook::callAll('unfollow', $hook_data);
### src/Model/Profile.php ### src/Model/Profile.php

View File

@ -356,6 +356,7 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
Hook::callAll('contact_photo_menu', $args); Hook::callAll('contact_photo_menu', $args);
Hook::callAll('follow', $arr); Hook::callAll('follow', $arr);
Hook::callAll('unfollow', $hook_data);
### src/Model/Profile.php ### src/Model/Profile.php

View File

@ -144,7 +144,7 @@ function unfollow_process(string $url)
Contact::terminateFriendship($owner, $contact, $dissolve); Contact::terminateFriendship($owner, $contact, $dissolve);
} }
// Sharing-only contacts get deleted as there no relationship any more // Sharing-only contacts get deleted as there no relationship anymore
if ($dissolve) { if ($dissolve) {
Contact::remove($contact['id']); Contact::remove($contact['id']);
$return_path = $base_return_path; $return_path = $base_return_path;

View File

@ -871,6 +871,12 @@ class Contact
if ($dissolve) { if ($dissolve) {
ActivityPub\Transmitter::sendContactReject($contact['url'], $contact['hub-verify'], $user['uid']); ActivityPub\Transmitter::sendContactReject($contact['url'], $contact['hub-verify'], $user['uid']);
} }
} else {
$hook_data = [
'contact' => $contact,
'dissolve' => $dissolve,
];
Hook::callAll('unfollow', $hook_data);
} }
} }

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2021.12-dev\n" "Project-Id-Version: 2021.12-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-25 18:43+0000\n" "POT-Creation-Date: 2021-09-26 03:07+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -184,32 +184,32 @@ msgstr ""
msgid "Follow Thread" msgid "Follow Thread"
msgstr "" msgstr ""
#: include/conversation.php:854 src/Model/Contact.php:1076 #: include/conversation.php:854 src/Model/Contact.php:1082
msgid "View Status" msgid "View Status"
msgstr "" msgstr ""
#: include/conversation.php:855 include/conversation.php:877 #: include/conversation.php:855 include/conversation.php:877
#: src/Model/Contact.php:1002 src/Model/Contact.php:1068 #: src/Model/Contact.php:1008 src/Model/Contact.php:1074
#: src/Model/Contact.php:1077 src/Module/Directory.php:160 #: src/Model/Contact.php:1083 src/Module/Directory.php:160
#: src/Module/Settings/Profile/Index.php:223 #: src/Module/Settings/Profile/Index.php:223
msgid "View Profile" msgid "View Profile"
msgstr "" msgstr ""
#: include/conversation.php:856 src/Model/Contact.php:1078 #: include/conversation.php:856 src/Model/Contact.php:1084
msgid "View Photos" msgid "View Photos"
msgstr "" msgstr ""
#: include/conversation.php:857 src/Model/Contact.php:1069 #: include/conversation.php:857 src/Model/Contact.php:1075
#: src/Model/Contact.php:1079 #: src/Model/Contact.php:1085
msgid "Network Posts" msgid "Network Posts"
msgstr "" msgstr ""
#: include/conversation.php:858 src/Model/Contact.php:1070 #: include/conversation.php:858 src/Model/Contact.php:1076
#: src/Model/Contact.php:1080 #: src/Model/Contact.php:1086
msgid "View Contact" msgid "View Contact"
msgstr "" msgstr ""
#: include/conversation.php:859 src/Model/Contact.php:1082 #: include/conversation.php:859 src/Model/Contact.php:1088
msgid "Send PM" msgid "Send PM"
msgstr "" msgstr ""
@ -232,12 +232,12 @@ msgstr ""
msgid "Languages" msgid "Languages"
msgstr "" msgstr ""
#: include/conversation.php:869 src/Model/Contact.php:1083 #: include/conversation.php:869 src/Model/Contact.php:1089
msgid "Poke" msgid "Poke"
msgstr "" msgstr ""
#: include/conversation.php:874 mod/follow.php:138 src/Content/Widget.php:76 #: include/conversation.php:874 mod/follow.php:138 src/Content/Widget.php:76
#: src/Model/Contact.php:1071 src/Model/Contact.php:1084 #: src/Model/Contact.php:1077 src/Model/Contact.php:1090
#: view/theme/vier/theme.php:172 #: view/theme/vier/theme.php:172
msgid "Connect/Follow" msgid "Connect/Follow"
msgstr "" msgstr ""
@ -3498,7 +3498,7 @@ msgstr ""
msgid "Organisations" msgid "Organisations"
msgstr "" msgstr ""
#: src/Content/Widget.php:529 src/Model/Contact.php:1499 #: src/Content/Widget.php:529 src/Model/Contact.php:1505
msgid "News" msgid "News"
msgstr "" msgstr ""
@ -4362,85 +4362,85 @@ msgstr ""
msgid "Legacy module file not found: %s" msgid "Legacy module file not found: %s"
msgstr "" msgstr ""
#: src/Model/Contact.php:1072 src/Model/Contact.php:1085 #: src/Model/Contact.php:1078 src/Model/Contact.php:1091
msgid "UnFollow" msgid "UnFollow"
msgstr "" msgstr ""
#: src/Model/Contact.php:1081 #: src/Model/Contact.php:1087
msgid "Drop Contact" msgid "Drop Contact"
msgstr "" msgstr ""
#: src/Model/Contact.php:1091 src/Module/Admin/Users/Pending.php:107 #: src/Model/Contact.php:1097 src/Module/Admin/Users/Pending.php:107
#: src/Module/Notifications/Introductions.php:111 #: src/Module/Notifications/Introductions.php:111
#: src/Module/Notifications/Introductions.php:183 #: src/Module/Notifications/Introductions.php:183
msgid "Approve" msgid "Approve"
msgstr "" msgstr ""
#: src/Model/Contact.php:1495 #: src/Model/Contact.php:1501
msgid "Organisation" msgid "Organisation"
msgstr "" msgstr ""
#: src/Model/Contact.php:1503 #: src/Model/Contact.php:1509
msgid "Forum" msgid "Forum"
msgstr "" msgstr ""
#: src/Model/Contact.php:2359 #: src/Model/Contact.php:2365
msgid "Disallowed profile URL." msgid "Disallowed profile URL."
msgstr "" msgstr ""
#: src/Model/Contact.php:2364 src/Module/Friendica.php:81 #: src/Model/Contact.php:2370 src/Module/Friendica.php:81
msgid "Blocked domain" msgid "Blocked domain"
msgstr "" msgstr ""
#: src/Model/Contact.php:2369 #: src/Model/Contact.php:2375
msgid "Connect URL missing." msgid "Connect URL missing."
msgstr "" msgstr ""
#: src/Model/Contact.php:2378 #: src/Model/Contact.php:2384
msgid "" msgid ""
"The contact could not be added. Please check the relevant network " "The contact could not be added. Please check the relevant network "
"credentials in your Settings -> Social Networks page." "credentials in your Settings -> Social Networks page."
msgstr "" msgstr ""
#: src/Model/Contact.php:2415 #: src/Model/Contact.php:2421
msgid "The profile address specified does not provide adequate information." msgid "The profile address specified does not provide adequate information."
msgstr "" msgstr ""
#: src/Model/Contact.php:2417 #: src/Model/Contact.php:2423
msgid "No compatible communication protocols or feeds were discovered." msgid "No compatible communication protocols or feeds were discovered."
msgstr "" msgstr ""
#: src/Model/Contact.php:2420 #: src/Model/Contact.php:2426
msgid "An author or name was not found." msgid "An author or name was not found."
msgstr "" msgstr ""
#: src/Model/Contact.php:2423 #: src/Model/Contact.php:2429
msgid "No browser URL could be matched to this address." msgid "No browser URL could be matched to this address."
msgstr "" msgstr ""
#: src/Model/Contact.php:2426 #: src/Model/Contact.php:2432
msgid "" msgid ""
"Unable to match @-style Identity Address with a known protocol or email " "Unable to match @-style Identity Address with a known protocol or email "
"contact." "contact."
msgstr "" msgstr ""
#: src/Model/Contact.php:2427 #: src/Model/Contact.php:2433
msgid "Use mailto: in front of address to force email check." msgid "Use mailto: in front of address to force email check."
msgstr "" msgstr ""
#: src/Model/Contact.php:2433 #: src/Model/Contact.php:2439
msgid "" msgid ""
"The profile address specified belongs to a network which has been disabled " "The profile address specified belongs to a network which has been disabled "
"on this site." "on this site."
msgstr "" msgstr ""
#: src/Model/Contact.php:2438 #: src/Model/Contact.php:2444
msgid "" msgid ""
"Limited profile. This person will be unable to receive direct/personal " "Limited profile. This person will be unable to receive direct/personal "
"notifications from you." "notifications from you."
msgstr "" msgstr ""
#: src/Model/Contact.php:2497 #: src/Model/Contact.php:2503
msgid "Unable to retrieve contact information." msgid "Unable to retrieve contact information."
msgstr "" msgstr ""