2026-01-30 15:56:58 +00:00
package main
import (
"github.com/diamondburned/gotk4/pkg/gtk/v4"
2026-05-19 14:07:21 +01:00
"gosrc.io/xmpp/stanza"
2026-03-15 09:55:26 +00:00
"mellium.im/xmpp/color"
2026-01-30 15:56:58 +00:00
"sync"
)
2026-08-16 20:07:53 +01:00
type abMessage struct {
label_ref * gtk . Label
ocu_id string
}
2026-01-30 15:56:58 +00:00
type chatTab struct {
2026-05-09 07:33:47 +01:00
isMuc bool
msgs * gtk . ListBox
2026-08-16 20:07:53 +01:00
msg_refsID map [ string ] * abMessage
2026-08-20 11:01:25 +01:00
msg_refsOSID map [ string ] * abMessage
2026-05-09 07:33:47 +01:00
name string
current_nick string
2026-05-18 06:27:55 +01:00
muc_presence * stanza . Presence
2026-01-30 15:56:58 +00:00
}
2026-07-30 01:39:31 +01:00
type BlockingMode int
const (
2026-08-16 20:07:53 +01:00
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
2026-08-08 13:54:20 +01:00
)
type DiscoveryMode int
const (
2026-08-16 20:07:53 +01:00
Everyone DiscoveryMode = iota // All entities can query
OnlyRoster // Only people on your roster can query
None // Nobody can query
2026-07-30 01:39:31 +01:00
)
2026-01-30 15:56:58 +00:00
type lambdaConfig struct {
2026-07-30 01:39:31 +01:00
Server string
Username string
Resource string
Password string
Insecure bool
Nick string
JoinBookmarks bool
CVD color . CVD
Identicons bool
Debug bool
2026-05-31 16:44:04 +01:00
ShowPresenceUpdates bool
CompactMode bool
ShowAvatarsInMemberList bool
2026-07-30 01:39:31 +01:00
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
2026-08-08 13:54:20 +01:00
RandomizeResource bool // If this is set to true, then the resource will be completely randomized by the server on every single connect
2026-08-20 11:01:25 +01:00
// Local Bookmarks
LocalBookmarks map [ string ] string // key: JID, value: Nickname
2026-08-08 13:54:20 +01:00
// Privacy settings
2026-08-16 20:07:53 +01:00
DiscoPrivacy DiscoveryMode // Whether or not Lambda will report its service discovery features and Identity. Reccomended mode is Everyone, Default is Everyone
2026-08-08 13:54:20 +01:00
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
2026-01-30 15:56:58 +00:00
}
type mucUnit struct {
2026-03-15 09:57:08 +00:00
// key: Resource
2026-01-30 15:56:58 +00:00
// value: last user presence
Members sync . Map
}
2026-01-30 21:31:33 +00:00
type userUnit struct {
2026-01-31 15:08:54 +00:00
// key: Resource
2026-01-30 21:31:33 +00:00
// value: last presence of this device
Devices sync . Map
}