feat: auto-register mumble bots on first connect
Self-register with the Mumble server on initial connection so both derp and merlin get persistent identities (cert-bound user_id). Skips registration on reconnect or if already registered. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -254,6 +254,16 @@ class MumbleBot:
|
||||
self._mumble.users.myself.deafen()
|
||||
except Exception:
|
||||
log.exception("mumble: failed to self-deafen on connect")
|
||||
# Self-register on first connect so the server stores the cert
|
||||
# and treats this bot as a known user (persistent identity).
|
||||
if self._connect_count == 1:
|
||||
try:
|
||||
myself = self._mumble.users.myself
|
||||
if not myself.get("user_id"):
|
||||
myself.register()
|
||||
log.info("mumble: self-registered %s", self._username)
|
||||
except Exception:
|
||||
log.debug("mumble: self-register skipped (already registered?)")
|
||||
if self._loop:
|
||||
asyncio.run_coroutine_threadsafe(
|
||||
self._notify_plugins_connected(), self._loop,
|
||||
|
||||
Reference in New Issue
Block a user