mastodon fixes for last commit
This commit is contained in:
parent
a37a4cb9f9
commit
3968aba9c3
|
@ -54,7 +54,6 @@ class ApiExternalUserShowAction extends ApiPrivateAuthAction
|
|||
$this->profile = new stdClass();
|
||||
$this->profile->external = null;
|
||||
$this->profile->local = null;
|
||||
$this->profile->ostatus = null;
|
||||
|
||||
// the user might not exist in our db yet, try to use the Ostatus plugin
|
||||
// to get it in there
|
||||
|
@ -112,6 +111,8 @@ class ApiExternalUserShowAction extends ApiPrivateAuthAction
|
|||
|
||||
if($local_profile instanceof Profile) {
|
||||
|
||||
$this->profile->local = $this->twitterUserArray($local_profile);
|
||||
|
||||
// if profile url is not ending with nickname, this is probably a single user instance
|
||||
if(!substr($local_profile->profileurl, -strlen($local_profile->nickname))===$local_profile->nickname) {
|
||||
$external_instance_url = $local_profile->profileurl;
|
||||
|
@ -128,7 +129,6 @@ class ApiExternalUserShowAction extends ApiPrivateAuthAction
|
|||
}
|
||||
|
||||
$this->profile->external = $external_profile;
|
||||
$this->profile->local = $this->twitterUserArray($local_profile);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1096,6 +1096,11 @@ function guessInstanceUrlWithoutProtocolFromProfileUrlAndNickname(profileUrl, ni
|
|||
guessedInstanceUrl = guessedInstanceUrl.slice(0,-1);
|
||||
}
|
||||
|
||||
// fix new mastodon style profile urls
|
||||
if(guessedInstanceUrl.indexOf('/@') > -1) {
|
||||
guessedInstanceUrl = guessedInstanceUrl.substring(0, guessedInstanceUrl.indexOf('/@'));
|
||||
}
|
||||
|
||||
return guessedInstanceUrl;
|
||||
}
|
||||
|
||||
|
|
|
@ -532,6 +532,7 @@ $('#find-someone input').keyup(function(e){
|
|||
var domain = val.substring(val.indexOf('@')+1);
|
||||
var urlToTry = 'https://' + domain + '/' + username;
|
||||
var secondUrlToTry = 'http://' + domain + '/' + username;
|
||||
var thirdUrlToTry = 'https://' + domain + '/@' + username; // mastodon
|
||||
|
||||
getFromAPI('qvitter/external_user_show.json?profileurl=' + encodeURIComponent(urlToTry),function(data){
|
||||
if(data && data.local !== null) {
|
||||
|
@ -541,6 +542,13 @@ $('#find-someone input').keyup(function(e){
|
|||
}
|
||||
else {
|
||||
getFromAPI('qvitter/external_user_show.json?profileurl=' + encodeURIComponent(secondUrlToTry),function(data){
|
||||
if(data && data.local !== null) {
|
||||
setNewCurrentStream(pathToStreamRouter('user/' + data.local.id),true,false,function(){
|
||||
foundSomeone(thisFindSomeoneInput);
|
||||
});
|
||||
}
|
||||
else {
|
||||
getFromAPI('qvitter/external_user_show.json?profileurl=' + encodeURIComponent(thirdUrlToTry),function(data){
|
||||
if(data && data.local !== null) {
|
||||
setNewCurrentStream(pathToStreamRouter('user/' + data.local.id),true,false,function(){
|
||||
foundSomeone(thisFindSomeoneInput);
|
||||
|
@ -553,13 +561,14 @@ $('#find-someone input').keyup(function(e){
|
|||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
cantFindSomeone(thisFindSomeoneInput);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function cantFindSomeone(thisFindSomeoneInput) {
|
||||
thisFindSomeoneInput.css('background-color','pink');
|
||||
thisFindSomeoneInput.effect('shake',{distance:5,times:3,duration:700},function(){
|
||||
|
|
Loading…
Reference in New Issue
Block a user