mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Space inviter: DM admin to confirm invites for Space-less local users
New optional plugin (FEATURE_SPACE_INVITER) that detects local homeserver users who aren't in any Matrix Space and prompts the configured admin via DM with yes/no/ignore. Persistent prompt log in space_inviter_prompts so restarts and upgrades don't re-ping for users who already replied. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
9
main.go
9
main.go
@@ -191,6 +191,10 @@ func main() {
|
||||
registry.Register(plugin.NewShadePlugin(client))
|
||||
registry.Register(plugin.NewWelcomePlugin(client, xpPlugin, registry))
|
||||
|
||||
// Space inviter (admin-prompted invites for Space-less local users)
|
||||
spaceInviter := plugin.NewSpaceInviterPlugin(client)
|
||||
registry.Register(spaceInviter)
|
||||
|
||||
// Initialize all plugins
|
||||
if err := registry.Init(); err != nil {
|
||||
slog.Error("plugin init failed", "err", err)
|
||||
@@ -234,6 +238,11 @@ func main() {
|
||||
// Track join/leave/invite for moderation
|
||||
targetUser := id.UserID(evt.GetStateKey())
|
||||
modPlugin.OnMemberEvent(evt.RoomID, targetUser, mem.Membership)
|
||||
|
||||
// Space inviter: react to local-user joins
|
||||
if mem.Membership == event.MembershipJoin {
|
||||
spaceInviter.OnMemberJoin(targetUser)
|
||||
}
|
||||
})
|
||||
|
||||
// Message handler
|
||||
|
||||
Reference in New Issue
Block a user