TwidereProject / Twidere-Android

http://twidere.com
2.75k stars 377 forks source link

Can't open Friendica post in browser #1041

Closed Rudloff closed 6 years ago

Rudloff commented 6 years ago

I use a Friendica (GNU Social) account in Twidere 3.7.3.

Expected behavior

When I open a post and use Open in browser, it should open the post on my Friendica server.

Actual behavior

It tries to open https://mobile.twitter.com/[username]/status/[post_id] which generally does not exist.

Steps to reproduce

  1. Add a Friendica account to Twidere.
  2. Touch a post to see its details.
  3. Choose Open in browser in the post's menu.

Extra info

Android version: 6.0.1

Network type:

App version: 3.7.3

Build variant:

Micro-blogging service:

App settings:

mariotaku commented 6 years ago

I don't have such an instance. Could you paste JSON object, or URL link of your status here? If you don't want to make it public you can also send me email.

Rudloff commented 6 years ago

Here is an example status: https://social.rudloff.pro/display/de03dfa0135a1eaf11c200a900103524 And its JSON object (from https://social.rudloff.pro/api/statusnet/conversation/335105.json?count=20):

[
  {
    "text": "StreetComplete propose maintenant de renseigner si un restaurant est vegeta*ien \ud83d\ude0a\nhttps:\/\/github.com\/westnordost\/StreetComplete",
    "truncated": false,
    "created_at": "Wed Nov 29 12:58:57 +0000 2017",
    "in_reply_to_status_id": null,
    "in_reply_to_status_id_str": null,
    "source": "Twidere (Friendica)",
    "id": 335105,
    "id_str": "335105",
    "in_reply_to_user_id": null,
    "in_reply_to_user_id_str": null,
    "in_reply_to_screen_name": null,
    "geo": null,
    "favorited": false,
    "user": {
      "id": 13,
      "id_str": "13",
      "name": "Pierre Rudloff",
      "screen_name": "rudloff",
      "location": "",
      "description": "",
      "profile_image_url": "https:\/\/social.rudloff.pro\/photo\/524d58171fafc86b4121411e2283a062-6.jpg",
      "profile_image_url_https": "https:\/\/social.rudloff.pro\/photo\/524d58171fafc86b4121411e2283a062-6.jpg",
      "url": "https:\/\/social.rudloff.pro\/profile\/rudloff",
      "protected": false,
      "followers_count": 0,
      "friends_count": 0,
      "listed_count": 0,
      "created_at": "Fri Apr 07 19:06:23 +0000 2017",
      "favourites_count": 0,
      "utc_offset": "0",
      "time_zone": "UTC",
      "geo_enabled": false,
      "verified": true,
      "statuses_count": 0,
      "lang": "",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "following": false,
      "follow_request_sent": false,
      "statusnet_blocking": false,
      "notifications": false,
      "statusnet_profile_url": "https:\/\/social.rudloff.pro\/profile\/rudloff",
      "cid": 1,
      "network": "dfrn"
    },
    "friendica_owner": {
      "id": 13,
      "id_str": "13",
      "name": "Pierre Rudloff",
      "screen_name": "rudloff",
      "location": "",
      "description": "",
      "profile_image_url": "https:\/\/social.rudloff.pro\/photo\/524d58171fafc86b4121411e2283a062-6.jpg",
      "profile_image_url_https": "https:\/\/social.rudloff.pro\/photo\/524d58171fafc86b4121411e2283a062-6.jpg",
      "url": "https:\/\/social.rudloff.pro\/profile\/rudloff",
      "protected": false,
      "followers_count": 0,
      "friends_count": 0,
      "listed_count": 0,
      "created_at": "Fri Apr 07 19:06:23 +0000 2017",
      "favourites_count": 0,
      "utc_offset": "0",
      "time_zone": "UTC",
      "geo_enabled": false,
      "verified": true,
      "statuses_count": 0,
      "lang": "",
      "contributors_enabled": false,
      "is_translator": false,
      "is_translation_enabled": false,
      "following": false,
      "follow_request_sent": false,
      "statusnet_blocking": false,
      "notifications": false,
      "statusnet_profile_url": "https:\/\/social.rudloff.pro\/profile\/rudloff",
      "uid": 1,
      "cid": 1,
      "self": "1",
      "network": "dfrn"
    },
    "statusnet_html": "StreetComplete propose maintenant de renseigner si un restaurant est vegeta*ien &#128522;<br><a href=\"https:\/\/github.com\/westnordost\/StreetComplete\" target=\"_blank\">https:\/\/github.com\/westnordost\/StreetComplete<\/a><br><a href=\"https:\/\/social.rudloff.pro\/photos\/rudloff\/image\/2e3e2e60551ffb750f1e1c778fe43b77\/?zrl=https%3A%2F%2Fsocial.rudloff.pro%2Fprofile%2Frudloff\" target=\"_blank\"><img src=\"https:\/\/social.rudloff.pro\/photo\/2e3e2e60551ffb750f1e1c778fe43b77-1.png\" alt=\"Image\/photo\"><\/a>",
    "statusnet_conversation_id": "335105",
    "friendica_activities": {
      "like": [],
      "dislike": [],
      "attendyes": [],
      "attendno": [],
      "attendmaybe": []
    },
    "attachments": [
      {
        "url": "https:\/\/social.rudloff.pro\/photo\/2e3e2e60551ffb750f1e1c778fe43b77-1.png",
        "mimetype": "image\/png",
        "size": 60214
      }
    ]
  }
]
annando commented 6 years ago

@mariotaku If you need additional data in the post, please tell. Then I will enhance the output.

mariotaku commented 6 years ago

@annando A field with permalink to this status would be nice. It called external_url in GNUSocial FYI. You can name it whatever you want and tell me when it's ready.

annando commented 6 years ago

I would adopt GS. Since I do have two GS installations, I will check there and adopt the changes.

annando commented 6 years ago

PR is done.

Rudloff commented 6 years ago

I confirm it now works correctly. Thanks everyone!