switches username and preferred_username
This commit is contained in:
@@ -43,7 +43,7 @@ func SplitHandle(handle string) (string, string) {
|
|||||||
func GetActorByHandle(app core.App, handle string, includeFollows bool) (*core.Record, error) {
|
func GetActorByHandle(app core.App, handle string, includeFollows bool) (*core.Record, error) {
|
||||||
username, domain := SplitHandle(handle)
|
username, domain := SplitHandle(handle)
|
||||||
|
|
||||||
filter := "username={:username}&&"
|
filter := "preferred_username={:username}&&"
|
||||||
if domain != "" {
|
if domain != "" {
|
||||||
filter += "domain={:domain}"
|
filter += "domain={:domain}"
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ func processTrailAnnounceActivity(app core.App, actor *core.Record, activity pub
|
|||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"id": trail.Id,
|
"id": trail.Id,
|
||||||
"trail": trail.GetString("name"),
|
"trail": trail.GetString("name"),
|
||||||
"author": fmt.Sprintf("@%s@%s", actor.GetString("username"), actor.GetString("domain")),
|
"author": fmt.Sprintf("@%s@%s", actor.GetString("preferred_username"), actor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
@@ -261,7 +261,7 @@ func processListAnnounceActivity(app core.App, actor *core.Record, activity pub.
|
|||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"id": list.Id,
|
"id": list.Id,
|
||||||
"list": list.GetString("name"),
|
"list": list.GetString("name"),
|
||||||
"author": fmt.Sprintf("@%s@%s", actor.GetString("username"), actor.GetString("domain")),
|
"author": fmt.Sprintf("@%s@%s", actor.GetString("preferred_username"), actor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ func CreateSummitLogActivity(app core.App, summitLog *core.Record, typ pub.Activ
|
|||||||
logObject.AttributedTo = pub.IRI(summitLogAuthor.GetString("iri"))
|
logObject.AttributedTo = pub.IRI(summitLogAuthor.GetString("iri"))
|
||||||
logObject.Published = summitLog.GetDateTime("created").Time()
|
logObject.Published = summitLog.GetDateTime("created").Time()
|
||||||
logObject.ID = pub.IRI(fmt.Sprintf("%s/api/v1/summit-log/%s", origin, summitLog.Id))
|
logObject.ID = pub.IRI(fmt.Sprintf("%s/api/v1/summit-log/%s", origin, summitLog.Id))
|
||||||
logObject.URL = pub.IRI(fmt.Sprintf("%s/trail/view/@%s/%s", origin, summitLogTrailAuthor.GetString("username"), summitLog.GetString("trail")))
|
logObject.URL = pub.IRI(fmt.Sprintf("%s/trail/view/@%s/%s", origin, summitLogTrailAuthor.GetString("preferred_username"), summitLog.GetString("trail")))
|
||||||
logObject.InReplyTo = trailIRI
|
logObject.InReplyTo = trailIRI
|
||||||
logObject.Tag = tags
|
logObject.Tag = tags
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ func processCreateOrUpdateTrailActivity(activity pub.Activity, app core.App, act
|
|||||||
Type: util.TrailMention,
|
Type: util.TrailMention,
|
||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"id": trail.Id,
|
"id": trail.Id,
|
||||||
"author": fmt.Sprintf("@%s@%s", actor.GetString("username"), actor.GetString("domain")),
|
"author": fmt.Sprintf("@%s@%s", actor.GetString("preferred_username"), actor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
@@ -584,7 +584,7 @@ func processCreateOrUpdateCommentActivity(activity pub.Activity, app core.App, a
|
|||||||
"comment": commentObject.Content.First().Value.String(),
|
"comment": commentObject.Content.First().Value.String(),
|
||||||
"trail_id": trail.Id,
|
"trail_id": trail.Id,
|
||||||
"trail_name": trail.GetString("name"),
|
"trail_name": trail.GetString("name"),
|
||||||
"trail_author": fmt.Sprintf("@%s@%s", trailAuthor.GetString("username"), trailAuthor.GetString("domain")),
|
"trail_author": fmt.Sprintf("@%s@%s", trailAuthor.GetString("preferred_username"), trailAuthor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
@@ -600,7 +600,7 @@ func processCreateOrUpdateCommentActivity(activity pub.Activity, app core.App, a
|
|||||||
"comment": commentObject.Content.First().Value.String(),
|
"comment": commentObject.Content.First().Value.String(),
|
||||||
"trail_id": trail.Id,
|
"trail_id": trail.Id,
|
||||||
"trail_name": trail.GetString("name"),
|
"trail_name": trail.GetString("name"),
|
||||||
"trail_author": fmt.Sprintf("@%s@%s", trailAuthor.GetString("username"), trailAuthor.GetString("domain")),
|
"trail_author": fmt.Sprintf("@%s@%s", trailAuthor.GetString("preferred_username"), trailAuthor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
@@ -764,7 +764,7 @@ func processCreateOrUpdateSummitLogActivity(activity pub.Activity, app core.App,
|
|||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"trail_id": trail.Id,
|
"trail_id": trail.Id,
|
||||||
"trail_name": trail.GetString("name"),
|
"trail_name": trail.GetString("name"),
|
||||||
"trail_author": fmt.Sprintf("@%s@%s", trailAuthor.GetString("username"), trailAuthor.GetString("domain")),
|
"trail_author": fmt.Sprintf("@%s@%s", trailAuthor.GetString("preferred_username"), trailAuthor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
@@ -780,7 +780,7 @@ func processCreateOrUpdateSummitLogActivity(activity pub.Activity, app core.App,
|
|||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"trail_id": trail.Id,
|
"trail_id": trail.Id,
|
||||||
"trail_name": trail.GetString("name"),
|
"trail_name": trail.GetString("name"),
|
||||||
"trail_author": fmt.Sprintf("@%s@%s", trailAuthor.GetString("username"), trailAuthor.GetString("domain")),
|
"trail_author": fmt.Sprintf("@%s@%s", trailAuthor.GetString("preferred_username"), trailAuthor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ func ProcessFollowActivity(app core.App, actor *core.Record, activity pub.Activi
|
|||||||
notification := util.Notification{
|
notification := util.Notification{
|
||||||
Type: util.NewFollower,
|
Type: util.NewFollower,
|
||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"follower": fmt.Sprintf("@%s@%s", actor.GetString("username"), actor.GetString("domain")),
|
"follower": fmt.Sprintf("@%s@%s", actor.GetString("preferred_username"), actor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ func ProcessLikeActivity(app core.App, actor *core.Record, activity pub.Activity
|
|||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"trail_id": trail.Id,
|
"trail_id": trail.Id,
|
||||||
"trail_name": trail.GetString("name"),
|
"trail_name": trail.GetString("name"),
|
||||||
"trail_author": fmt.Sprintf("@%s", trailAuthor.GetString("username")),
|
"trail_author": fmt.Sprintf("@%s", trailAuthor.GetString("preferred_username")),
|
||||||
"liker": fmt.Sprintf("@%s@%s", actor.GetString("username"), actor.GetString("domain")),
|
"liker": fmt.Sprintf("@%s@%s", actor.GetString("preferred_username"), actor.GetString("domain")),
|
||||||
},
|
},
|
||||||
Seen: false,
|
Seen: false,
|
||||||
Author: actor.Id,
|
Author: actor.Id,
|
||||||
|
|||||||
58
db/migrations/1750774093_swap_preferred_username.go
Normal file
58
db/migrations/1750774093_swap_preferred_username.go
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package migrations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/pocketbase/pocketbase/core"
|
||||||
|
m "github.com/pocketbase/pocketbase/migrations"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
m.Register(func(app core.App) error {
|
||||||
|
actors, err := app.FindAllRecords("activitypub_actors")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, a := range actors {
|
||||||
|
if !a.GetBool("isLocal") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
username := a.GetString("username")
|
||||||
|
preferredUsername := a.GetString("preferred_username")
|
||||||
|
|
||||||
|
a.Set("username", preferredUsername)
|
||||||
|
a.Set("preferred_username", username)
|
||||||
|
|
||||||
|
err = app.Save(a)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}, func(app core.App) error {
|
||||||
|
actors, err := app.FindAllRecords("activitypub_actors")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, a := range actors {
|
||||||
|
if !a.GetBool("isLocal") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
username := a.GetString("username")
|
||||||
|
preferredUsername := a.GetString("preferred_username")
|
||||||
|
|
||||||
|
a.Set("username", preferredUsername)
|
||||||
|
a.Set("preferred_username", username)
|
||||||
|
|
||||||
|
err = app.Save(a)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}
|
||||||
40
db/migrations/1750780092_updated_timeline.go
Normal file
40
db/migrations/1750780092_updated_timeline.go
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
package migrations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"github.com/pocketbase/pocketbase/core"
|
||||||
|
m "github.com/pocketbase/pocketbase/migrations"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
m.Register(func(app core.App) error {
|
||||||
|
collection, err := app.FindCollectionByNameOrId("pbc_468398817")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// update collection data
|
||||||
|
if err := json.Unmarshal([]byte(`{
|
||||||
|
"viewQuery": "SELECT\n id,\n trail_id,\n trail_author_username,\n trail_author_domain,\n trail_iri,\n date,\n name,\n description,\n gpx,\n author,\n photos,\n distance,\n duration,\n elevation_gain,\n elevation_loss,\n created,\n type\nFROM\n (\n SELECT\n summit_logs.id,\n summit_logs.trail as trail_id,\n tapa.preferred_username as trail_author_username,\n tapa.domain as trail_author_domain,\n trails.iri as trail_iri,\n summit_logs.date,\n trails.name,\n text as description,\n summit_logs.gpx,\n sapa.iri as author,\n summit_logs.photos,\n summit_logs.distance,\n summit_logs.duration,\n summit_logs.elevation_gain,\n summit_logs.elevation_loss,\n summit_logs.created,\n \"summit_log\" as type\n FROM\n summit_logs\n JOIN trails ON summit_logs.trail = trails.id\n JOIN activitypub_actors sapa ON sapa.id = summit_logs.author\n JOIN activitypub_actors tapa ON tapa.id = trails.author\n UNION\n SELECT\n trails.id,\n trails.id as trail_id,\n activitypub_actors.preferred_username as trail_author_username,\n activitypub_actors.domain as trail_author_domain,\n trails.iri as trail_iri,\n date,\n trails.name,\n description,\n gpx,\n activitypub_actors.iri as author,\n photos,\n distance,\n duration,\n elevation_gain,\n elevation_loss,\n trails.created,\n \"trail\" as type\n FROM\n trails\n JOIN activitypub_actors ON activitypub_actors.id = trails.author\n )\nORDER BY\n created DESC;\n"
|
||||||
|
}`), &collection); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return app.Save(collection)
|
||||||
|
}, func(app core.App) error {
|
||||||
|
collection, err := app.FindCollectionByNameOrId("pbc_468398817")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// update collection data
|
||||||
|
if err := json.Unmarshal([]byte(`{
|
||||||
|
"viewQuery": "SELECT\n id,\n trail_id,\n trail_author_username,\n trail_author_domain,\n trail_iri,\n date,\n name,\n description,\n gpx,\n author,\n photos,\n distance,\n duration,\n elevation_gain,\n elevation_loss,\n created,\n type\nFROM\n (\n SELECT\n summit_logs.id,\n summit_logs.trail as trail_id,\n tapa.username as trail_author_username,\n tapa.domain as trail_author_domain,\n trails.iri as trail_iri,\n summit_logs.date,\n trails.name,\n text as description,\n summit_logs.gpx,\n sapa.iri as author,\n summit_logs.photos,\n summit_logs.distance,\n summit_logs.duration,\n summit_logs.elevation_gain,\n summit_logs.elevation_loss,\n summit_logs.created,\n \"summit_log\" as type\n FROM\n summit_logs\n JOIN trails ON summit_logs.trail = trails.id\n JOIN activitypub_actors sapa ON sapa.id = summit_logs.author\n JOIN activitypub_actors tapa ON tapa.id = trails.author\n UNION\n SELECT\n trails.id,\n trails.id as trail_id,\n activitypub_actors.username as trail_author_username,\n activitypub_actors.domain as trail_author_domain,\n trails.iri as trail_iri,\n date,\n trails.name,\n description,\n gpx,\n activitypub_actors.iri as author,\n photos,\n distance,\n duration,\n elevation_gain,\n elevation_loss,\n trails.created,\n \"trail\" as type\n FROM\n trails\n JOIN activitypub_actors ON activitypub_actors.id = trails.author\n )\nORDER BY\n created DESC;\n"
|
||||||
|
}`), &collection); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return app.Save(collection)
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -64,7 +64,7 @@ func ActorFromUser(app core.App, u *core.Record) (*core.Record, error) {
|
|||||||
if origin == "" {
|
if origin == "" {
|
||||||
return nil, fmt.Errorf("ORIGIN environment variable not set")
|
return nil, fmt.Errorf("ORIGIN environment variable not set")
|
||||||
}
|
}
|
||||||
id := fmt.Sprintf("%s/api/v1/activitypub/user/%s", origin, strings.ToLower(u.GetString("username")))
|
id := fmt.Sprintf("%s/api/v1/activitypub/user/%s", origin, strings.ToLower(u.GetString("preferred_username")))
|
||||||
|
|
||||||
url, err := url.Parse(origin)
|
url, err := url.Parse(origin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -72,8 +72,8 @@ func ActorFromUser(app core.App, u *core.Record) (*core.Record, error) {
|
|||||||
}
|
}
|
||||||
domain := strings.TrimPrefix(url.Hostname(), "www.")
|
domain := strings.TrimPrefix(url.Hostname(), "www.")
|
||||||
|
|
||||||
record.Set("username", strings.ToLower(u.GetString("username")))
|
record.Set("username", u.GetString("username"))
|
||||||
record.Set("preferred_username", u.GetString("username"))
|
record.Set("preferred_username", strings.ToLower(u.GetString("username")))
|
||||||
record.Set("domain", domain)
|
record.Set("domain", domain)
|
||||||
record.Set("summary", settings.GetString("bio"))
|
record.Set("summary", settings.GetString("bio"))
|
||||||
record.Set("published", u.GetDateTime("created"))
|
record.Set("published", u.GetDateTime("created"))
|
||||||
@@ -398,7 +398,7 @@ func ObjectFromTrail(app core.App, trail *core.Record, mentions *pub.ItemCollect
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
activityURL := fmt.Sprintf("%s/trail/view/@%s/%s", origin, trailAuthor.GetString("username"), trail.Id)
|
activityURL := fmt.Sprintf("%s/trail/view/@%s/%s", origin, trailAuthor.GetString("preferred_username"), trail.Id)
|
||||||
activityContent := fmt.Sprintf("<h1>%s</h1>%s<p><a href=\"%s\">%s</a></p>", trail.GetString("name"), trail.GetString("description"), activityURL, activityURL)
|
activityContent := fmt.Sprintf("<h1>%s</h1>%s<p><a href=\"%s\">%s</a></p>", trail.GetString("name"), trail.GetString("description"), activityURL, activityURL)
|
||||||
|
|
||||||
trailObject := pub.ObjectNew(pub.NoteType)
|
trailObject := pub.ObjectNew(pub.NoteType)
|
||||||
@@ -508,7 +508,7 @@ func ObjectFromList(app core.App, list *core.Record) (*pub.Object, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activityURL := fmt.Sprintf("%s/lists/@%s/%s", origin, listAuthor.GetString("username"), list.Id)
|
activityURL := fmt.Sprintf("%s/lists/@%s/%s", origin, listAuthor.GetString("preferred_username"), list.Id)
|
||||||
activityContent := fmt.Sprintf("%s<p><a href=\"%s\">%s</a></p>", list.GetString("description"), activityURL, activityURL)
|
activityContent := fmt.Sprintf("%s<p><a href=\"%s\">%s</a></p>", list.GetString("description"), activityURL, activityURL)
|
||||||
|
|
||||||
listObject := pub.ObjectNew(pub.NoteType)
|
listObject := pub.ObjectNew(pub.NoteType)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ func documentFromTrailRecord(app core.App, r *core.Record, author *core.Record,
|
|||||||
document := map[string]any{
|
document := map[string]any{
|
||||||
"id": r.Id,
|
"id": r.Id,
|
||||||
"author": author.Id,
|
"author": author.Id,
|
||||||
"author_name": author.GetString("username"),
|
"author_name": author.GetString("preferred_username"),
|
||||||
"author_avatar": author.GetString("icon"),
|
"author_avatar": author.GetString("icon"),
|
||||||
"name": r.GetString("name"),
|
"name": r.GetString("name"),
|
||||||
"description": r.GetString("description"),
|
"description": r.GetString("description"),
|
||||||
@@ -174,7 +174,7 @@ func documentFromListRecord(r *core.Record, author *core.Record, includeShares b
|
|||||||
document := map[string]interface{}{
|
document := map[string]interface{}{
|
||||||
"id": r.Id,
|
"id": r.Id,
|
||||||
"author": author.Id,
|
"author": author.Id,
|
||||||
"author_name": author.GetString("username"),
|
"author_name": author.GetString("preferred_username"),
|
||||||
"author_avatar": author.GetString("icon"),
|
"author_avatar": author.GetString("icon"),
|
||||||
"avatar": r.GetString("avatar"),
|
"avatar": r.GetString("avatar"),
|
||||||
"name": r.GetString("name"),
|
"name": r.GetString("name"),
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ func SendNotification(app core.App, notification Notification, recipient *core.R
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
html, err := GenerateHTML(app.Settings().Meta.AppURL, recipientActor.GetString("username"), authorActor.GetString("username"), notification.Type, notification.Metadata)
|
html, err := GenerateHTML(app.Settings().Meta.AppURL, recipientActor.GetString("preferred_username"), authorActor.GetString("preferred_username"), notification.Type, notification.Metadata)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
try {
|
try {
|
||||||
const actors: Actor[] = await searchActors(q, includeSelf);
|
const actors: Actor[] = await searchActors(q, includeSelf);
|
||||||
searchItems = actors.map((a) => ({
|
searchItems = actors.map((a) => ({
|
||||||
text: a.preferred_username!,
|
text: "a.username!",
|
||||||
description: `@${a.username}${a.isLocal ? "" : "@" + a.domain}`,
|
description: `@${a.preferred_username}${a.isLocal ? "" : "@" + a.domain}`,
|
||||||
value: a,
|
value: a,
|
||||||
icon: "user",
|
icon: "user",
|
||||||
}));
|
}));
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onClick(item: SearchItem) {
|
function onClick(item: SearchItem) {
|
||||||
value = item.value.username ?? value;
|
value = item.value.preferred_username ?? value;
|
||||||
|
|
||||||
onclick?.(item);
|
onclick?.(item);
|
||||||
searchItems = [];
|
searchItems = [];
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-8 aspect-square mr-2"
|
class="rounded-full w-8 aspect-square mr-2"
|
||||||
src={item.value.icon ||
|
src={item.value.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${item.value.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${item.value.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -105,12 +105,12 @@
|
|||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
return actors.map((a) => ({
|
return actors.map((a) => ({
|
||||||
text: a.preferred_username!,
|
text: a.username!,
|
||||||
description: `@${a.username}${a.isLocal ? "" : "@" + a.domain}`,
|
description: `@${a.preferred_username}${a.isLocal ? "" : "@" + a.domain}`,
|
||||||
value: a,
|
value: a,
|
||||||
icon:
|
icon:
|
||||||
a.icon ||
|
a.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${a.username}&backgroundType=gradientLinear`,
|
`https://api.dicebear.com/7.x/initials/svg?seed=${a.preferred_username}&backgroundType=gradientLinear`,
|
||||||
}));
|
}));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
let avatarSrc = $derived(
|
let avatarSrc = $derived(
|
||||||
comment.expand?.author.icon
|
comment.expand?.author.icon
|
||||||
? comment.expand?.author.icon
|
? comment.expand?.author.icon
|
||||||
: `https://api.dicebear.com/7.x/initials/svg?seed=${comment.expand?.author.username ?? ""}&backgroundType=gradientLinear`,
|
: `https://api.dicebear.com/7.x/initials/svg?seed=${comment.expand?.author.preferred_username ?? ""}&backgroundType=gradientLinear`,
|
||||||
);
|
);
|
||||||
|
|
||||||
let timeSince = $derived(formatTimeSince(new Date(comment.created ?? "")));
|
let timeSince = $derived(formatTimeSince(new Date(comment.created ?? "")));
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-5 aspect-square mx-1 inline"
|
class="rounded-full w-5 aspect-square mx-1 inline"
|
||||||
src={list.expand.author.icon ||
|
src={list.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${list.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${list.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
{handleFromRecordWithIRI(list)}
|
{handleFromRecordWithIRI(list)}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-8 aspect-square mx-1 inline"
|
class="rounded-full w-8 aspect-square mx-1 inline"
|
||||||
src={list.expand.author.icon ||
|
src={list.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${list.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${list.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
<a class="underline" href="/profile/{handleFromRecordWithIRI(list)}"
|
<a class="underline" href="/profile/{handleFromRecordWithIRI(list)}"
|
||||||
|
|||||||
@@ -157,11 +157,11 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-8 aspect-square mr-2"
|
class="rounded-full w-8 aspect-square mr-2"
|
||||||
src={share.expand.actor.icon ||
|
src={share.expand.actor.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${share.expand.actor.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${share.expand.actor.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
<p>
|
<p>
|
||||||
{`@${share.expand.actor.username}${share.expand.actor.isLocal ? "" : "@" + share.expand.actor.domain}`}
|
{`@${share.expand.actor.preferred_username}${share.expand.actor.isLocal ? "" : "@" + share.expand.actor.domain}`}
|
||||||
</p>
|
</p>
|
||||||
<span
|
<span
|
||||||
class="basis-full text-sm text-center text-gray-500"
|
class="basis-full text-sm text-center text-gray-500"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
const avatarSrc = notification.expand?.author.icon
|
const avatarSrc = notification.expand?.author.icon
|
||||||
? notification.expand.author.icon
|
? notification.expand.author.icon
|
||||||
: `https://api.dicebear.com/7.x/initials/svg?seed=${notification.expand?.author.username ?? ""}&backgroundType=gradientLinear`;
|
: `https://api.dicebear.com/7.x/initials/svg?seed=${notification.expand?.author.preferred_username ?? ""}&backgroundType=gradientLinear`;
|
||||||
|
|
||||||
const timeSince = formatTimeSince(new Date(notification.created ?? ""));
|
const timeSince = formatTimeSince(new Date(notification.created ?? ""));
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-10 aspect-square overflow-hidden"
|
class="rounded-full w-10 aspect-square overflow-hidden"
|
||||||
src={actor.icon ||
|
src={actor.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${actor.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${actor.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-8 aspect-square mr-2"
|
class="rounded-full w-8 aspect-square mr-2"
|
||||||
src={share.expand.actor.icon ||
|
src={share.expand.actor.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${share.expand.actor.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${share.expand.actor.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
<p class="font-semibold text-base">
|
<p class="font-semibold text-base">
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-8 aspect-square mr-2"
|
class="rounded-full w-8 aspect-square mr-2"
|
||||||
src={subject.expand.author.icon ||
|
src={subject.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${subject.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${subject.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
<p class="font-semibold">
|
<p class="font-semibold">
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-5 aspect-square mx-1 inline"
|
class="rounded-full w-5 aspect-square mx-1 inline"
|
||||||
src={log.expand.author.icon ||
|
src={log.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${log.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${log.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
{handleFromRecordWithIRI(log)}
|
{handleFromRecordWithIRI(log)}
|
||||||
|
|||||||
@@ -189,13 +189,13 @@
|
|||||||
<td>
|
<td>
|
||||||
<p
|
<p
|
||||||
class="tooltip flex justify-center"
|
class="tooltip flex justify-center"
|
||||||
data-title="{log.expand.author.username}{log.expand.author
|
data-title="@{log.expand.author.preferred_username}{log.expand.author
|
||||||
.isLocal
|
.isLocal
|
||||||
? ''
|
? ''
|
||||||
: '@' + log.expand.author.domain}"
|
: '@' + log.expand.author.domain}"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href="/profile/@{log.expand.author.username?.toLowerCase()}{log
|
href="/profile/@{log.expand.author.preferred_username?.toLowerCase()}{log
|
||||||
.expand.author.isLocal
|
.expand.author.isLocal
|
||||||
? ''
|
? ''
|
||||||
: '@' + log.expand.author.domain}"
|
: '@' + log.expand.author.domain}"
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-7 aspect-square"
|
class="rounded-full w-7 aspect-square"
|
||||||
src={log.expand.author.icon ||
|
src={log.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${log.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${log.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -130,10 +130,10 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-5 aspect-square mx-1 inline"
|
class="rounded-full w-5 aspect-square mx-1 inline"
|
||||||
src={trail.expand.author.icon ||
|
src={trail.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
{trail.expand.author.username}{trail.expand.author.isLocal
|
{trail.expand.author.preferred_username}{trail.expand.author.isLocal
|
||||||
? ""
|
? ""
|
||||||
: "@" + trail.expand.author.domain}
|
: "@" + trail.expand.author.domain}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -377,7 +377,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-8 aspect-square mx-1 inline"
|
class="rounded-full w-8 aspect-square mx-1 inline"
|
||||||
src={trail.expand.author.icon ||
|
src={trail.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
<a class="underline" href="/profile/{handle}"
|
<a class="underline" href="/profile/{handle}"
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-5 aspect-square mx-1 inline"
|
class="rounded-full w-5 aspect-square mx-1 inline"
|
||||||
src={trail.expand.author.icon ||
|
src={trail.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
{handleFromRecordWithIRI(trail)}
|
{handleFromRecordWithIRI(trail)}
|
||||||
|
|||||||
@@ -88,10 +88,10 @@
|
|||||||
{#if trail.expand && trail.expand.author}
|
{#if trail.expand && trail.expand.author}
|
||||||
<div class="author-icon">
|
<div class="author-icon">
|
||||||
<img
|
<img
|
||||||
title={`${trail.public ? $_("public") + " " : ""}${$_("by")} ${trail.expand.author.username}${trail.expand.author.isLocal ? "" : "@" + trail.expand.author.domain}`}
|
title={`${trail.public ? $_("public") + " " : ""}${$_("by")} @${trail.expand.author.preferred_username}${trail.expand.author.isLocal ? "" : "@" + trail.expand.author.domain}`}
|
||||||
class="rounded-full w-5 aspect-square mx-1 inline"
|
class="rounded-full w-5 aspect-square mx-1 inline"
|
||||||
src={trail.expand.author.icon ||
|
src={trail.expand.author.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${trail.expand.author.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ export async function searchResultToLists(hits: Hits<ListSearchResult>): Promise
|
|||||||
author: {
|
author: {
|
||||||
icon: h.author_avatar,
|
icon: h.author_avatar,
|
||||||
id: h.author,
|
id: h.author,
|
||||||
username: h.author_name,
|
preferred_username: h.author_name,
|
||||||
} as any,
|
} as any,
|
||||||
list_share_via_list: h.shares?.map(s => ({
|
list_share_via_list: h.shares?.map(s => ({
|
||||||
permission: "view",
|
permission: "view",
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ export async function searchResultToTrailList(hits: Hits<TrailSearchResult>): Pr
|
|||||||
isLocal: (h.domain?.length ?? 0) == 0,
|
isLocal: (h.domain?.length ?? 0) == 0,
|
||||||
id: h.author,
|
id: h.author,
|
||||||
icon: h.author_avatar,
|
icon: h.author_avatar,
|
||||||
username: h.author_name,
|
preferred_username: h.author_name,
|
||||||
domain: h.domain,
|
domain: h.domain,
|
||||||
} as any,
|
} as any,
|
||||||
trail_share_via_trail: h.shares?.map(s => ({
|
trail_share_via_trail: h.shares?.map(s => ({
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ export function handleFromRecordWithIRI(record: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!record.iri) {
|
if (!record.iri) {
|
||||||
return `@${record.expand.author.username}`
|
return `@${record.expand.author.preferred_username}`
|
||||||
}
|
}
|
||||||
const url = new URL(record.iri ?? "")
|
const url = new URL(record.iri ?? "")
|
||||||
|
|
||||||
return `@${record.expand.author.username}@${url.hostname}`
|
return `@${record.expand.author.preferred_username}@${url.hostname}`
|
||||||
}
|
}
|
||||||
@@ -34,11 +34,11 @@
|
|||||||
const actors = await searchActors(q);
|
const actors = await searchActors(q);
|
||||||
searchDropdownItems = actors.map((a) => ({
|
searchDropdownItems = actors.map((a) => ({
|
||||||
text: a.username,
|
text: a.username,
|
||||||
description: `@${a.username}${a.isLocal ? "" : "@" + a.domain}`,
|
description: `@${a.preferred_username}${a.isLocal ? "" : "@" + a.domain}`,
|
||||||
value: a,
|
value: a,
|
||||||
icon:
|
icon:
|
||||||
a.icon ||
|
a.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${a.username}&backgroundType=gradientLinear`,
|
`https://api.dicebear.com/7.x/initials/svg?seed=${a.preferred_username}&backgroundType=gradientLinear`,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
const r = await searchMulti({
|
const r = await searchMulti({
|
||||||
@@ -89,9 +89,9 @@
|
|||||||
goto(`/trail/view/${item.value}`);
|
goto(`/trail/view/${item.value}`);
|
||||||
} else if (item.icon == "layer-group") {
|
} else if (item.icon == "layer-group") {
|
||||||
goto(`/lists/${item.value}`);
|
goto(`/lists/${item.value}`);
|
||||||
} else if (item.value.username) {
|
} else if (item.value.preferred_username) {
|
||||||
goto(
|
goto(
|
||||||
`/profile/@${item.value.username}${item.value.isLocal ? "" : "@" + item.value.domain}`,
|
`/profile/@${item.value.preferred_username}${item.value.isLocal ? "" : "@" + item.value.domain}`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
goto(`/map/?lat=${item.value.lat}&lon=${item.value.lon}`);
|
goto(`/map/?lat=${item.value.lat}&lon=${item.value.lon}`);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export async function GET(event: RequestEvent) {
|
|||||||
outbox: id + '/outbox',
|
outbox: id + '/outbox',
|
||||||
summary: user.bio,
|
summary: user.bio,
|
||||||
name: actor.username,
|
name: actor.username,
|
||||||
preferredUsername: user.username,
|
preferredUsername: actor.preferred_username,
|
||||||
followers: id + '/followers',
|
followers: id + '/followers',
|
||||||
following: id + '/following',
|
following: id + '/following',
|
||||||
url: `${env.ORIGIN}/profile/@${username}`,
|
url: `${env.ORIGIN}/profile/@${username}`,
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ export async function GET(event: RequestEvent) {
|
|||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
remoteComments.items.forEach(c => {
|
||||||
|
if (!c.iri?.length) {
|
||||||
|
c.iri = `${url}/${c.id}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const allCommentItems = <ListResult<Comment>>{
|
const allCommentItems = <ListResult<Comment>>{
|
||||||
items: localComments.items.concat(remoteComments.items),
|
items: localComments.items.concat(remoteComments.items),
|
||||||
page: localComments.page,
|
page: localComments.page,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export async function POST(event: RequestEvent) {
|
|||||||
r = await event.locals.ms.index("lists").search(data.q, { ...data.options, filter: `author = ${actor.id}` });
|
r = await event.locals.ms.index("lists").search(data.q, { ...data.options, filter: `author = ${actor.id}` });
|
||||||
} else {
|
} else {
|
||||||
const origin = new URL(actor.iri).origin
|
const origin = new URL(actor.iri).origin
|
||||||
const url = `${origin}/api/v1/profile/${actor.username}/lists?` + event.url.searchParams
|
const url = `${origin}/api/v1/profile/${actor.preferred_username}/lists?` + event.url.searchParams
|
||||||
const response = await event.fetch(url, { method: 'POST', body: JSON.stringify(data) })
|
const response = await event.fetch(url, { method: 'POST', body: JSON.stringify(data) })
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export async function GET(event: RequestEvent) {
|
|||||||
.getList<SummitLog>(safeSearchParams.page, safeSearchParams.perPage, { ...safeSearchParams, filter: `author='${actor.id}'` })
|
.getList<SummitLog>(safeSearchParams.page, safeSearchParams.perPage, { ...safeSearchParams, filter: `author='${actor.id}'` })
|
||||||
} else {
|
} else {
|
||||||
const origin = new URL(actor.iri).origin
|
const origin = new URL(actor.iri).origin
|
||||||
const summitLogURL = `${origin}/api/v1/profile/${actor.username}/stats?` + event.url.searchParams
|
const summitLogURL = `${origin}/api/v1/profile/${actor.preferred_username}/stats?` + event.url.searchParams
|
||||||
const response = await event.fetch(summitLogURL, { method: 'GET' })
|
const response = await event.fetch(summitLogURL, { method: 'GET' })
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const errorResponse = await response.json()
|
const errorResponse = await response.json()
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export async function GET(event: RequestEvent) {
|
|||||||
.getList<TimelineItem>(safeSearchParams.page, safeSearchParams.perPage, { ...safeSearchParams, filter: `author='${actor.iri}'` })
|
.getList<TimelineItem>(safeSearchParams.page, safeSearchParams.perPage, { ...safeSearchParams, filter: `author='${actor.iri}'` })
|
||||||
} else {
|
} else {
|
||||||
const origin = new URL(actor.iri).origin
|
const origin = new URL(actor.iri).origin
|
||||||
const timelineURL = `${origin}/api/v1/profile/${actor.username}/timeline?` + event.url.searchParams
|
const timelineURL = `${origin}/api/v1/profile/${actor.preferred_username}/timeline?` + event.url.searchParams
|
||||||
|
|
||||||
const response = await event.fetch(timelineURL, { method: 'GET' })
|
const response = await event.fetch(timelineURL, { method: 'GET' })
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export async function POST(event: RequestEvent) {
|
|||||||
r = await event.locals.ms.index("trails").search(data.q, { ...data.options, filter: `author = ${actor.id}` });
|
r = await event.locals.ms.index("trails").search(data.q, { ...data.options, filter: `author = ${actor.id}` });
|
||||||
} else {
|
} else {
|
||||||
const origin = new URL(actor.iri).origin
|
const origin = new URL(actor.iri).origin
|
||||||
const url = `${origin}/api/v1/profile/${actor.username}/trails?` + event.url.searchParams
|
const url = `${origin}/api/v1/profile/${actor.preferred_username}/trails?` + event.url.searchParams
|
||||||
const response = await event.fetch(url, { method: 'POST', body: JSON.stringify(data) })
|
const response = await event.fetch(url, { method: 'POST', body: JSON.stringify(data) })
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ export async function GET(event: RequestEvent) {
|
|||||||
}
|
}
|
||||||
t = {
|
t = {
|
||||||
iri: iri,
|
iri: iri,
|
||||||
author: actor.id
|
author: actor.id,
|
||||||
|
like_count: 0
|
||||||
} as Trail
|
} as Trail
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,13 +64,13 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-16 aspect-square overflow-hidden shrink-0"
|
class="rounded-full w-16 aspect-square overflow-hidden shrink-0"
|
||||||
src={data.profile.icon ||
|
src={data.profile.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${data.profile.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${data.profile.preferredUsername}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<h4 class="text-2xl font-semibold col-start-2">
|
<h4 class="text-2xl font-semibold col-start-2">
|
||||||
{data.profile.preferredUsername ??
|
{data.profile.username ??
|
||||||
data.profile.username}
|
"?"}
|
||||||
</h4>
|
</h4>
|
||||||
<p class="text-sm text-gray-500 mb-4 break-all">
|
<p class="text-sm text-gray-500 mb-4 break-all">
|
||||||
{data.profile.acct}
|
{data.profile.acct}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<h4 class="text-xl font-semibold">
|
<h4 class="text-xl font-semibold">
|
||||||
{$_("about")}
|
{$_("about")}
|
||||||
{data.profile.preferredUsername}
|
{data.profile.username}
|
||||||
{#if data.isOwnProfile && data.profile.bio.length}
|
{#if data.isOwnProfile && data.profile.bio.length}
|
||||||
<a aria-label="Edit bio" class="ml-4" href="/settings/profile"
|
<a aria-label="Edit bio" class="ml-4" href="/settings/profile"
|
||||||
><i class="fa fa-pen text-base"></i></a
|
><i class="fa fa-pen text-base"></i></a
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
<ul class="space-y-4">
|
<ul class="space-y-4">
|
||||||
{#each follows.items as follow}
|
{#each follows.items as follow}
|
||||||
<a
|
<a
|
||||||
href="/profile/@{follow.username}{follow.isLocal
|
href="/profile/@{follow.preferred_username}{follow.isLocal
|
||||||
? ''
|
? ''
|
||||||
: '@' + follow.domain}"
|
: '@' + follow.domain}"
|
||||||
>
|
>
|
||||||
@@ -74,15 +74,15 @@
|
|||||||
<img
|
<img
|
||||||
class="rounded-full w-10 aspect-square overflow-hidden"
|
class="rounded-full w-10 aspect-square overflow-hidden"
|
||||||
src={follow.icon ||
|
src={follow.icon ||
|
||||||
`https://api.dicebear.com/7.x/initials/svg?seed=${follow.username}&backgroundType=gradientLinear`}
|
`https://api.dicebear.com/7.x/initials/svg?seed=${follow.preferred_username}&backgroundType=gradientLinear`}
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<p class="text-lg font-medium">
|
<p class="text-lg font-medium">
|
||||||
{follow.preferred_username}
|
{follow.username}
|
||||||
</p>
|
</p>
|
||||||
<p class="text-sm text-gray-500 break-all">
|
<p class="text-sm text-gray-500 break-all">
|
||||||
@{follow.username}@{follow.domain}
|
@{follow.preferred_username}@{follow.domain}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user