new_feature

package
v0.0.0-...-2154053 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const LocalServerUrl = "http://127.0.0.1:28008"
View Source
const MaxMemberCount int32 = 666
View Source
const RoomMsgNoticePath = "/_matrix/client/local/send_group_master_notice"
View Source
const ServerNoticePath = "/_matrix/client/local/send_server_notice"

Variables

This section is empty.

Functions

func CheckAvailable

func CheckAvailable(userLocal string, info InviteRes) (res, reason string)

func CheckMortgage

func CheckMortgage(userLocal string) bool

func CleanExpireHistoryMsgs

func CleanExpireHistoryMsgs(interval int64) error

func Decode

func Decode(privateKey string, msg []byte) ([]byte, error)

Decode addr

func ECCDecrypt

func ECCDecrypt(ct []byte, prk ecies.PrivateKey) ([]byte, error)

func ECCEncrypt

func ECCEncrypt(pt []byte, puk ecies.PublicKey) ([]byte, error)

func Encode

func Encode(eciesPublicKey string, msg []byte) ([]byte, error)

Encode eciesPublicKey

func GetHttpClient

func GetHttpClient(options ...interface{}) http.Client

func GetPayRelationByLocals

func GetPayRelationByLocals(from string, to []string) (map[string]bool, error)

func GetPubEcKeyFromPri

func GetPubEcKeyFromPri(priKey []byte) (string, error)

func Init

func Init(pri string, cfgServername string, federation *gomatrixserverlib.FederationClient)

func JudgeIfPayByLocals

func JudgeIfPayByLocals(from, to string) bool

func JudgeShouldAutoJoin

func JudgeShouldAutoJoin(inviterLocal, inviteeLocal string) (bool, error)

func PostJSONNoSpan

func PostJSONNoSpan(
	ctx context.Context, httpClient *http.Client,
	apiURL string, request, response interface{},
) error

PostJSONNoSpan performs a POST request with JSON on an internal HTTP API

func SendRoomNotice

func SendRoomNotice(ctx context.Context, userId, msgType, body, outType, roomId string) error

func SendServerNotice

func SendServerNotice(ctx context.Context, userId, msgType, body, outType string) error

func ServerDecode

func ServerDecode(msg string) ([]string, error)

ServerDecode addr

Types

type InfoRes

type InfoRes struct {
	Localpart     string   `json:"localpart"`
	LimitMode     string   `json:"limit_mode"`
	ChatFee       string   `json:"chat_fee"`
	Servername    string   `json:"servername"`
	Blacklist     []string `json:"blacklist"`
	Whitelist     []string `json:"whitelist"`
	MortgageLevel int64    `json:"mortgage_level"`
	TelNumbers    []string `json:"tel_numbers"`
}

func QueryUserInfoByLocal

func QueryUserInfoByLocal(local string) InfoRes

type InviteRes

type InviteRes struct {
	Localpart     string   `json:"localpart"`
	LimitMode     string   `json:"limit_mode"`
	ChatFee       string   `json:"chat_fee"`
	Servername    string   `json:"servername"`
	Blacklist     []string `json:"blacklist"`
	Whitelist     []string `json:"whitelist"`
	Payed         bool     `json:"payed"`
	Reason        string   `json:"reason"`
	MortgageLevel int64    `json:"mortgage_level"`
	TelNumbers    []string `json:"tel_numbers"`
}

func QueryAvailableByLocals

func QueryAvailableByLocals(userLocal string, locals []string) (available, needPays, cantChat []InviteRes, err error)

type UserRes

type UserRes struct {
	DisplayName string `json:"display_name"`
	AvatarURL   string `json:"avatar_url"`

	Localpart     string `json:"localpart"`
	Servername    string `json:"servername"`
	LimitMode     string `json:"limit_mode"` //  any fee list
	ChatFee       string `json:"chat_fee"`
	MortgageFee   string `json:"mortgage_fee"`
	MortgageLevel int64  `json:"mortgage_level"`

	TelNumbers []string `json:"tel_numbers"`
	Blacklist  []string `json:"blacklist"`
	Whitelist  []string `json:"whitelist"`

	CanWeTalk  bool   `json:"can_we_talk"`
	CanPayTalk bool   `json:"can_pay_talk"`
	PayedFee   string `json:"payed_fee"`
	Payed      bool   `json:"payed"`
}

func GetUserByPhone

func GetUserByPhone(userLocal string, phone int64) (res UserRes, err error)

GetUserByPhone

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL