mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
Format
This commit is contained in:
parent
20bc11f854
commit
920b154a41
4 changed files with 12 additions and 12 deletions
|
|
@ -2,8 +2,8 @@ package format
|
|||
|
||||
import (
|
||||
"gopkg.in/russross/blackfriday.v2"
|
||||
"strings"
|
||||
"maunium.net/go/gomatrix"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func RenderMarkdown(text string) gomatrix.Content {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ type ReqCreateRoom struct {
|
|||
Invite []string `json:"invite,omitempty"`
|
||||
Invite3PID []ReqInvite3PID `json:"invite_3pid,omitempty"`
|
||||
CreationContent map[string]interface{} `json:"creation_content,omitempty"`
|
||||
InitialState []*Event `json:"initial_state,omitempty"`
|
||||
InitialState []*Event `json:"initial_state,omitempty"`
|
||||
Preset string `json:"preset,omitempty"`
|
||||
IsDirect bool `json:"is_direct,omitempty"`
|
||||
}
|
||||
|
|
@ -79,4 +79,4 @@ type ReqTyping struct {
|
|||
|
||||
type ReqPresence struct {
|
||||
Presence string `json:"presence"`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
16
responses.go
16
responses.go
|
|
@ -63,9 +63,9 @@ type RespJoinedMembers struct {
|
|||
|
||||
// RespMessages is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-messages
|
||||
type RespMessages struct {
|
||||
Start string `json:"start"`
|
||||
Start string `json:"start"`
|
||||
Chunk []*Event `json:"chunk"`
|
||||
End string `json:"end"`
|
||||
End string `json:"end"`
|
||||
}
|
||||
|
||||
// RespSendEvent is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid
|
||||
|
|
@ -146,8 +146,8 @@ type RespSync struct {
|
|||
} `json:"state"`
|
||||
Timeline struct {
|
||||
Events []*Event `json:"events"`
|
||||
Limited bool `json:"limited"`
|
||||
PrevBatch string `json:"prev_batch"`
|
||||
Limited bool `json:"limited"`
|
||||
PrevBatch string `json:"prev_batch"`
|
||||
} `json:"timeline"`
|
||||
} `json:"leave"`
|
||||
Join map[string]struct {
|
||||
|
|
@ -156,14 +156,14 @@ type RespSync struct {
|
|||
} `json:"state"`
|
||||
Timeline struct {
|
||||
Events []*Event `json:"events"`
|
||||
Limited bool `json:"limited"`
|
||||
PrevBatch string `json:"prev_batch"`
|
||||
Limited bool `json:"limited"`
|
||||
PrevBatch string `json:"prev_batch"`
|
||||
} `json:"timeline"`
|
||||
Ephemeral struct {
|
||||
Events []*Event `json:"events"`
|
||||
Events []*Event `json:"events"`
|
||||
} `json:"ephemeral"`
|
||||
AccountData struct {
|
||||
Events []*Event `json:"events"`
|
||||
Events []*Event `json:"events"`
|
||||
} `json:"account_data"`
|
||||
} `json:"join"`
|
||||
Invite map[string]struct {
|
||||
|
|
|
|||
|
|
@ -125,6 +125,6 @@ func ExtractUserLocalpart(userID string) (string, error) {
|
|||
}
|
||||
return strings.TrimPrefix(
|
||||
strings.SplitN(userID, ":", 2)[0], // @foo:bar:8448 => [ "@foo", "bar:8448" ]
|
||||
"@", // remove "@" prefix
|
||||
"@", // remove "@" prefix
|
||||
), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue