-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more robust social ids for social sync #1843
Conversation
call-me-matt
commented
Oct 10, 2020
•
edited
Loading
edited
- resolve facebook-id from usernames
- accept mastodon userids without leading 'at'
- ignore apple markers as in Remove quotes from TYPE for better external platforms compatibility #1107 (comment)
Codecov Report
@@ Coverage Diff @@
## master #1843 +/- ##
=========================================
Coverage ? 37.02%
Complexity ? 160
=========================================
Files ? 19
Lines ? 497
Branches ? 0
=========================================
Hits ? 184
Misses ? 313
Partials ? 0
Continue to review full report at Codecov.
|
@@ -35,6 +35,7 @@ public function __construct() { | |||
* @return string | |||
*/ | |||
public function cleanupId(string $candidate):?string { | |||
$candidate = preg_replace('/^' . preg_quote('x-apple:', '/') . '/', '', $candidate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should go into the level above so $candidate is already sanitized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$profileId = $socialProvider->cleanupId($socialEntry['value']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, it can be there, too. But apple only attaches this to custom fields. For certain networks (for example Facebook and Twitter) it adds the domain of the service and no x-apple. So because it is not valid for all networks, I only added it where necessary. I'll let you decide where it's best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I guess it's easier to have it once and for all rather than on every provider?
Maybe I'm missing something 🤔 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to be clear: we do not need it for every provider. apple only adds this "x-apple" thingy to the networks it does not know. All pre-defined networks (in the iOS-contacts-app) don't have that tag. So I thought its more a temporary thing and it can be removed time after time from the known networks.
fdfd7da
to
f5214be
Compare
big news: I found a better way to get the profile id from facebook for any profile! It works very nicely (until fb changes their site...) |
f5214be
to
be213fb
Compare
- get facebook id from usernames - accept mastodon usernames without leading at - ignore iOS marker as in 1107#issuecomment-706518724 Signed-off-by: call-me-matt <nextcloud@matthiasheinisch.de>
be213fb
to
e3814b7
Compare