more fedi tweaks

This commit is contained in:
Administrator 2025-09-01 19:03:42 -07:00
parent 2f6cf12ddd
commit ecc5c7257e
2 changed files with 17 additions and 5 deletions

View file

@ -15,11 +15,11 @@ class Object
end end
# #
def new_message(*args) def new_message(*args)
# if args[0].is_a?(Hash) unless @uuid
# ::GxG::Events::Message.new({:sender => self, :subject => args[1], :body => nil}.merge(args[0])) @uuid = ::GxG::uuid_generate.to_s.to_sym
# else ::GxG::CHANNELS.create_channel(@uuid)
::GxG::Events::Message.new({:sender => self, :subject => args[1], :body => args[0]}) end
# end ::GxG::Events::Message.new({:sender => @uuid, :subject => args[1], :body => args[0]})
end end
# logging hooks # logging hooks
def log_unknown(message = nil, progname = nil, &block) def log_unknown(message = nil, progname = nil, &block)
@ -127,6 +127,17 @@ class Object
end end
result result
end 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 end
# #
module GxG module GxG

View file

@ -1087,6 +1087,7 @@ module GxG
@csrf = nil @csrf = nil
@the_connector = self @the_connector = self
# Make introduction to host and aquire csrf token # Make introduction to host and aquire csrf token
::GxG::CHANNELS.create_channel(@uuid)
the_introduction = new_message({:introduction => @uuid.to_s}) the_introduction = new_message({:introduction => @uuid.to_s})
the_introduction[:sender] = @uuid.to_s the_introduction[:sender] = @uuid.to_s
the_introduction[:to] = @host_prefix.to_s the_introduction[:to] = @host_prefix.to_s