Compare commits

..

No commits in common. "679348d1f732d9f6928babf61e75398fd7d74a43" and "0f33427d5b5cfb92783dfecba63475da4116001c" have entirely different histories.

2 changed files with 2 additions and 28 deletions

View file

@ -108,7 +108,6 @@ type MisskeyStatus struct {
type AccountMisskey struct {
ID string `json:"id"`
Host string `json:"host"`
Name string `json:"name"`
Username string `json:"username"`
AvatarURL string `json:"avatarUrl"`
@ -273,17 +272,12 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
}
withFiles := "false"
withReplies := "false"
globalTimeline := false
for _, instanceParam := range instanceParams {
switch instanceParam {
case "withFiles":
withFiles = "true"
params.Set("only_media", "true")
case "withReplies":
withReplies = "true"
case "remote":
globalTimeline = true
params.Set(instanceParam, "true")
default:
params.Set(instanceParam, "true")
}
@ -294,11 +288,7 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
var bytesAttach []byte
switch instance_type {
case "misskey":
if globalTimeline {
perform.Path = "api/notes/global-timeline"
} else {
perform.Path = "api/notes/local-timeline"
}
perform.RawQuery = ""
method = http.MethodPost
ContentType = "application/json"
@ -345,11 +335,7 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
status.ID = statusMisskey.ID
status.Account.ID = statusMisskey.User.ID
status.Account.DisplayName = statusMisskey.User.Name
if statusMisskey.User.Host != "" {
status.Account.Acct = statusMisskey.User.Username + "@" + statusMisskey.User.Host
} else {
status.Account.Acct = statusMisskey.User.Username
}
status.Account.Username = statusMisskey.User.Username
status.Account.Avatar = statusMisskey.User.AvatarURL
status.CreatedAt = statusMisskey.CreatedAt
@ -385,14 +371,6 @@ func (c *Client) TrueRemoteTimeline(ctx context.Context, instance string, instan
status.URL = "https://" + instance + "/notes/" + statusMisskey.ID
publicstatuses = append(publicstatuses, &status)
}
case "friendica":
err = json.NewDecoder(resp.Body).Decode(&publicstatuses)
if err != nil {
return nil, err
}
for _, status := range publicstatuses {
status.URL = status.URI // Fix federate URL
}
default:
err = json.NewDecoder(resp.Body).Decode(&publicstatuses)
if err != nil {

View file

@ -26,14 +26,10 @@
<select id="instance_type" name="instance_type" title="Select instance type">
<option value="mastodon-compatible" default>Mastodon compatible</option>
<option value="misskey"{{if eq .InstanceType "misskey"}}selected{{end}}>Misskey</option>
<option value="friendica"{{if eq .InstanceType "friendica"}}selected{{end}}>Friendica</option>
</select>
</span>
<button type="submit"> Submit </button>
</form>
{{if eq .Instance ""}}
<span>Possible params:<br>withFiles - show posts only with media<br>remote - try fetch their global timeline<br>You can combine params: withFile:remote:some_other_param</span>
{{end}}
{{end}}
{{if eq .Type "tag"}}
<form class="search-form" action="/timeline/tag" method="GET">