Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsBEXHeader(input []byte) bool
- func EncodeBEX(b []BEX) []byte
- func ValidColor(str string) bool
- type BEX
- type BEXHeader
- type Conn
- func (c *Conn) ActiveRooms() []string
- func (c *Conn) Answer(room, user, answer string)
- func (c *Conn) Ask(room, user, question, answer string)
- func (c *Conn) DM(room, user, message string)
- func (c *Conn) Disconnect()
- func (c *Conn) GM(room string, body string)
- func (c *Conn) GMf(room string, format string, args ...interface{})
- func (c *Conn) GetMods() []string
- func (c *Conn) GetRoom(name string) *Room
- func (c *Conn) Group(room string, b []byte)
- func (c *Conn) JoinRoom(room, nick string)
- func (c *Conn) On(_type EventType, handler EventHandler)
- func (c *Conn) Run() error
- func (c *Conn) SetColor(color string) error
- func (c *Conn) SetMods(s []string)
- func (c *Conn) Uptime() time.Duration
- type Database
- type Disk_DB
- type Event
- type EventHandler
- type EventType
- type File
- type ICECandidate
- type Member
- func (m *Member) Answer(data string)
- func (m *Member) Ask(question, answer string)
- func (m *Member) DM(data string)
- func (m *Member) HandleMessageEvent(event otr3.MessageEvent, message []byte, err error, trace ...interface{})
- func (m *Member) HandleSMPEvent(event otr3.SMPEvent, progressPercent int, question string)
- func (m *Member) HandleSecurityEvent(event otr3.SecurityEvent)
- func (m *Member) Name() string
- func (m *Member) Raw(str string)
- type Room
- func (r *Room) DM(user, data string)
- func (r *Room) Destroy()
- func (r *Room) Download(f *File) ([]byte, error)
- func (r *Room) GM(body string)
- func (r *Room) GetMember(s string) *Member
- func (m *Room) GetUsernames() []string
- func (r *Room) Group(b []byte)
- func (m *Room) GroupFingerprint(user string) string
- func (r *Room) IsBlocked(user string) bool
- func (r *Room) IsMod(user string) bool
- func (r *Room) SendBEXGroup(b []BEX)
- func (r *Room) SendBEXPrivate(nickname string, b []BEX)
- func (m *Room) SendGroupComposing()
- func (m *Room) SendGroupPaused()
- func (m *Room) SendPrivateComposing(target string)
- func (m *Room) SendPrivatePaused(target string)
- func (m *Room) SendXGroupComposing()
- func (m *Room) SendXGroupPaused()
- func (m *Room) SendXPrivateComposing(target string)
- func (m *Room) SendXPrivatePaused(target string)
- func (r *Room) SetModerationTable(tk string, tv []string)
- func (r *Room) Upload(fileMime string, data []byte) (*File, error)
Constants ¶
View Source
const ( // Opts flags BEXDisabled uint64 = 1 << 0 DMDisabled uint64 = 1 << 1 DebugXMPP uint64 = 1 << 2 Human uint64 = 1 << 3 )
View Source
const BexServer = "https://bex.pg.ikrypto.club"
Variables ¶
View Source
var ( // Separates this extension from a regular plaintext Cryptodog message. BEX_MAGIC = []byte{0x04, 0x45, 0xFF} )
Functions ¶
func ContainsBEXHeader ¶
func ValidColor ¶
Types ¶
type BEX ¶
type BEX struct { Header BEXHeader Color string `json:"color,omitempty"` Status string `json:"color,omitempty"` File *File `json:"file,omitempty"` MessageType string `json:"messageType,omitempty"` Message string `json:"message,omitempty"` SDPType string `json:"sdpType,omitempty"` SDPData string `json:"sdpData,omitempty"` ICECandidate string `json:"iceCandidate,omitempty"` SDPMLineIndex uint64 `json:"sdpMLineIndex,omitempty"` SDPMid string `json:"sdpMid,omitempty"` Target string `json:"target,omitempty"` Level uint64 `json:"level,omitempty"` TableKey string `json:"tableKey,omitempty"` Table []string `json:"table,omitempty"` }
type BEXHeader ¶
type BEXHeader uint64
const ( NOT_VALID BEXHeader = 0 // Packet headers SET_COLOR BEXHeader = 1 PING BEXHeader = 2 PONG BEXHeader = 3 BEX_COMPOSING BEXHeader = 4 BEX_PAUSED BEXHeader = 5 FILE_ATTACHMENT BEXHeader = 6 TEXT_MESSAGE BEXHeader = 7 FLAG_ME_AS_BOT BEXHeader = 8 STATUS_ONLINE BEXHeader = 9 STATUS_AWAY BEXHeader = 10 MOD_ELECTED BEXHeader = 11 REMOVE_DEAD_USERS BEXHeader = 12 SET_MODERATION_TABLE BEXHeader = 13 SET_LOCKDOWN_LEVEL BEXHeader = 14 WHITELIST_USER BEXHeader = 15 // WebRTC ICE_CANDIDATE BEXHeader = 30 RTC_OFFER BEXHeader = 31 RTC_ANSWER BEXHeader = 32 RTC_SIGNAL_CAPABILITY BEXHeader = 33 RTC_SIGNAL_DISABLED BEXHeader = 34 )
type Conn ¶
type Conn struct { // Public Options DB Database URL string Host string Conference string Proxy string Opts uint64 // contains filtered or unexported fields }
func (*Conn) ActiveRooms ¶
func (*Conn) Disconnect ¶
func (c *Conn) Disconnect()
func (*Conn) On ¶
func (c *Conn) On(_type EventType, handler EventHandler)
On registers a function that will handle an Event.
type Database ¶
type Database interface { Load(k interface{}) (interface{}, bool) Store(k, v interface{}) Delete(k interface{}) }
type EventHandler ¶
type EventHandler func(Event)
type EventType ¶
type EventType int
const ( Any EventType = iota RateLimit NicknameInUse Disconnected Connected UserJoined UserLeft GroupMessage PrivateMessage SMPQuestion SMPAnswer SMPSuccess SMPFailure Composing Paused ColorModify FileAttachment SubscribedToModerator RoomJoined WebRTCCapable WebRTCOffer WebRTCAnswer WebRTCIceCandidate InvalidGroupMessage )
type ICECandidate ¶
type Member ¶
type Member struct { Bot bool // contains filtered or unexported fields }
func (*Member) HandleMessageEvent ¶
func (m *Member) HandleMessageEvent(event otr3.MessageEvent, message []byte, err error, trace ...interface{})
func (*Member) HandleSMPEvent ¶
func (*Member) HandleSecurityEvent ¶
func (m *Member) HandleSecurityEvent(event otr3.SecurityEvent)
type Room ¶
type Room struct { Name string MyName string Mp *multiparty.Me Members map[string]*Member ModerationTables map[string][]string // contains filtered or unexported fields }
func (*Room) GetUsernames ¶
func (*Room) GroupFingerprint ¶
func (*Room) SendBEXGroup ¶
func (*Room) SendBEXPrivate ¶
func (*Room) SendGroupComposing ¶
func (m *Room) SendGroupComposing()
Sends group composing message via Binary Extensions.
func (*Room) SendGroupPaused ¶
func (m *Room) SendGroupPaused()
Sends group paused message via Binary Extensions.
func (*Room) SendPrivateComposing ¶
Sends private composing message via Binary Extensions
func (*Room) SendPrivatePaused ¶
Sends private paused message via Binary Extensions
func (*Room) SendXGroupComposing ¶
func (m *Room) SendXGroupComposing()
Sends composing message via XMPP.
func (*Room) SendXGroupPaused ¶
func (m *Room) SendXGroupPaused()
func (*Room) SendXPrivateComposing ¶
func (*Room) SendXPrivatePaused ¶
func (*Room) SetModerationTable ¶
Click to show internal directories.
Click to hide internal directories.