better outbound emoji
This commit is contained in:
parent
34adc4b8dc
commit
d11ce38a6f
16
activity.go
16
activity.go
|
@ -1306,6 +1306,22 @@ func chonkifymsg(user *WhatAbout, ch *Chonk) []byte {
|
|||
if len(atts) > 0 {
|
||||
jo["attachment"] = atts
|
||||
}
|
||||
var tags []junk.Junk
|
||||
for _, e := range herdofemus(ch.Noise) {
|
||||
t := junk.New()
|
||||
t["id"] = e.ID
|
||||
t["type"] = "Emoji"
|
||||
t["name"] = e.Name
|
||||
i := junk.New()
|
||||
i["type"] = "Image"
|
||||
i["mediaType"] = "image/png"
|
||||
i["url"] = e.ID
|
||||
t["icon"] = i
|
||||
tags = append(tags, t)
|
||||
}
|
||||
if len(tags) > 0 {
|
||||
jo["tag"] = tags
|
||||
}
|
||||
|
||||
j := junk.New()
|
||||
j["@context"] = itiswhatitis
|
||||
|
|
22
fun.go
22
fun.go
|
@ -177,19 +177,23 @@ func replaceimgsand(zap map[string]bool, absolute bool) func(node *html.Node) st
|
|||
}
|
||||
}
|
||||
|
||||
func filterchonk(ch *Chonk) {
|
||||
func translatechonk(ch *Chonk) {
|
||||
noise := ch.Noise
|
||||
if ch.Format == "markdown" {
|
||||
noise = markitzero(noise)
|
||||
}
|
||||
var htf htfilter.Filter
|
||||
htf.SpanClasses = allowedclasses
|
||||
htf.BaseURL, _ = url.Parse(ch.XID)
|
||||
noise := ch.Noise
|
||||
local := false
|
||||
if ch.Format == "markdown" {
|
||||
noise = markitzero(noise)
|
||||
local = true
|
||||
}
|
||||
|
||||
ch.HTML, _ = htf.String(noise)
|
||||
noise = string(ch.HTML)
|
||||
}
|
||||
|
||||
func filterchonk(ch *Chonk) {
|
||||
translatechonk(ch)
|
||||
|
||||
noise := string(ch.HTML)
|
||||
|
||||
local := originate(ch.XID) == serverName
|
||||
|
||||
zap := make(map[string]bool)
|
||||
emuxifier := func(e string) string {
|
||||
|
|
Loading…
Reference in New Issue