84 lines
2.2 KiB
Go
84 lines
2.2 KiB
Go
package main
|
|
|
|
import (
|
|
"github.com/diamondburned/gotk4/pkg/gtk/v4"
|
|
"gosrc.io/xmpp/stanza"
|
|
"mellium.im/xmpp/color"
|
|
"sync"
|
|
)
|
|
|
|
type chatTab struct {
|
|
isMuc bool
|
|
msgs *gtk.ListBox
|
|
name string
|
|
current_nick string
|
|
muc_presence *stanza.Presence
|
|
}
|
|
|
|
type BlockingMode int
|
|
|
|
const (
|
|
Drop BlockingMode = iota // Do not even process if the entity is blocked
|
|
Hide // Hide the message but allow the user to expand it if they wish (discord style)
|
|
Highlight // Just highlight the message in orange
|
|
)
|
|
|
|
type DiscoveryMode int
|
|
|
|
const (
|
|
Everyone DiscoveryMode = iota // All entities can query
|
|
OnlyRoster // Only people on your roster can query
|
|
None // Nobody can query
|
|
)
|
|
|
|
type lambdaConfig struct {
|
|
Server string
|
|
Username string
|
|
Resource string
|
|
Password string
|
|
Insecure bool
|
|
Nick string
|
|
JoinBookmarks bool
|
|
|
|
CVD color.CVD
|
|
Identicons bool
|
|
|
|
Debug bool
|
|
|
|
ShowPresenceUpdates bool
|
|
CompactMode bool
|
|
ShowAvatarsInMemberList bool
|
|
|
|
CustomNicks map[string]string // Anyone with a specific Occupant ID will have this nick
|
|
CustomNicksAV map[string]string // Anyone with a specific avatar hash will have this nick
|
|
|
|
BlockingOI map[string]bool // Any person who's Occupant ID is in this map will have their messages dropped
|
|
BlockingMode BlockingMode
|
|
|
|
CheckUpdate string
|
|
|
|
RandomizeResource bool // If this is set to true, then the resource will be completely randomized by the server on every single connect
|
|
|
|
// Privacy settings
|
|
DiscoPrivacy DiscoveryMode // Whether or not Lambda will report its service discovery features and Identity. Reccomended mode is Everyone, Default is Everyone
|
|
VersionPrivacy DiscoveryMode // Whether or not Lambda will report its version information. Reccomended mode is Roster, Default is Everyone
|
|
|
|
IgnoreInsteadOfReturnErrorUponPrivacyViolation bool // If set to true, Lambda will simply ignore Disco and Query Version requests from entities that are untrusted as per the user's discovery mode. If set to false, a service-unavailable error will be reported.
|
|
|
|
// Spoofing
|
|
|
|
// TODO
|
|
}
|
|
|
|
type mucUnit struct {
|
|
// key: Resource
|
|
// value: last user presence
|
|
Members sync.Map
|
|
}
|
|
|
|
type userUnit struct {
|
|
// key: Resource
|
|
// value: last presence of this device
|
|
Devices sync.Map
|
|
}
|