handle the new gnusocial API's URI parameter

This commit is contained in:
Hannes Mannerheim 2014-05-12 13:06:32 +02:00
parent e0bd433d6f
commit cdc1ba4ed8

View File

@ -1104,6 +1104,21 @@ function showConversation(qid) {
in_reply_to_screen_name = obj.in_reply_to_screen_name;
}
// gnu social don't use url as uri anymore, we need to handle both cases
if(obj.uri.substring(0,4) != 'http') {
// guess the url if we only have the non-url uri
if(typeof obj.url == 'undefined') {
var httpOrHttps = obj.user.statusnet_profile_url.substring(0,obj.user.statusnet_profile_url.indexOf('://'));
obj.uri = httpOrHttps + '://' + obj.uri.substring(4,obj.uri.indexOf(',')) + '/notice/' + obj.uri.substring(obj.uri.indexOf('noticeId=')+9,obj.uri.indexOf(':objectType'));
}
// if the new url record is present, use that
else {
obj.uri = obj.url;
}
}
// requeet or delete html
var requeetedClass = '';
if(obj.user.id == window.myUserID) {