From ecc5c7257ea5d18d12ace45ef088ebaa2b86553f Mon Sep 17 00:00:00 2001 From: "G. Gibson" Date: Mon, 1 Sep 2025 19:03:42 -0700 Subject: [PATCH] more fedi tweaks --- gxg/web/gxg.rb | 21 ++++++++++++++++----- gxg/web/gxg_comm.rb | 1 + 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gxg/web/gxg.rb b/gxg/web/gxg.rb index 93b4916..a4be588 100644 --- a/gxg/web/gxg.rb +++ b/gxg/web/gxg.rb @@ -15,11 +15,11 @@ class Object end # def new_message(*args) - # if args[0].is_a?(Hash) - # ::GxG::Events::Message.new({:sender => self, :subject => args[1], :body => nil}.merge(args[0])) - # else - ::GxG::Events::Message.new({:sender => self, :subject => args[1], :body => args[0]}) - # end + unless @uuid + @uuid = ::GxG::uuid_generate.to_s.to_sym + ::GxG::CHANNELS.create_channel(@uuid) + end + ::GxG::Events::Message.new({:sender => @uuid, :subject => args[1], :body => args[0]}) end # logging hooks def log_unknown(message = nil, progname = nil, &block) @@ -127,6 +127,17 @@ class Object end result end + # + def defederate() + if @uuid + the_channel = ::GxG::CHANNELS.fetch_channel(@uuid) + if the_channel + ::GxG::CHANNELS.destroy_channel(@uuid) + end + end + true + end + # end # module GxG diff --git a/gxg/web/gxg_comm.rb b/gxg/web/gxg_comm.rb index d4b3690..9fd7d14 100644 --- a/gxg/web/gxg_comm.rb +++ b/gxg/web/gxg_comm.rb @@ -1087,6 +1087,7 @@ module GxG @csrf = nil @the_connector = self # Make introduction to host and aquire csrf token + ::GxG::CHANNELS.create_channel(@uuid) the_introduction = new_message({:introduction => @uuid.to_s}) the_introduction[:sender] = @uuid.to_s the_introduction[:to] = @host_prefix.to_s