mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
Add support for Highlight (kind:9802)
This commit is contained in:
8
utils.go
8
utils.go
@@ -67,6 +67,7 @@ var kindNames = map[int]string{
|
||||
1984: "Reporting",
|
||||
9734: "Zap Request",
|
||||
9735: "Zap",
|
||||
9802: "Highlight",
|
||||
10000: "Mute List",
|
||||
10001: "Pin List",
|
||||
10002: "Relay List Metadata",
|
||||
@@ -107,6 +108,7 @@ var kindNIPs = map[int]string{
|
||||
1984: "56",
|
||||
9734: "57",
|
||||
9735: "57",
|
||||
9802: "84",
|
||||
10000: "51",
|
||||
10001: "51",
|
||||
10002: "65",
|
||||
@@ -254,6 +256,12 @@ func shortenNostrURLs(input string) string {
|
||||
})
|
||||
}
|
||||
|
||||
func shortenString(input string, before int, after int) string {
|
||||
firstChars := input[:before]
|
||||
lastChars := input[len(input)-after:]
|
||||
return firstChars + "…" + lastChars
|
||||
}
|
||||
|
||||
func getNameFromNip19(ctx context.Context, nip19code string) (string, bool) {
|
||||
metadata, _ := sys.FetchProfileFromInput(ctx, nip19code)
|
||||
if metadata.Name == "" {
|
||||
|
||||
Reference in New Issue
Block a user