From 19f4a1b3f26bf7e7bc22bda19229c85187c59b9e Mon Sep 17 00:00:00 2001 From: "G. Gibson" Date: Fri, 5 Sep 2025 17:44:23 -0700 Subject: [PATCH] federation fixes --- Services/www/www.rb | 13 +++++++++++++ Services/www/www/gxg-www.rb | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Services/www/www.rb b/Services/www/www.rb index ac84684..aa32e5a 100644 --- a/Services/www/www.rb +++ b/Services/www/www.rb @@ -223,6 +223,19 @@ class WebSocketListener if op_frame[:payload] the_channel.send_message(::GxG::Events::Message::import(JSON.parse(op_frame[:payload].to_s.decode64.decrypt(the_secret), {:symbolize_names => true}))) end + if op_frame[:open_channel] + unless ::GxG::CHANNELS.fetch_channel(op_frame[:open_channel].to_s.to_sym) + ::GxG::CHANNELS.create_channel(op_frame[:open_channel].to_s.to_sym) + new_channel = ::GxG::CHANNELS.fetch_channel(op_frame[:open_channel].to_s.to_sym) + if new_channel + new_channel.socket = the_channel.socket + new_channel.secret = the_channel.secret + end + end + end + if op_frame[:close_channel] + ::GxG::CHANNELS.destroy_channel(op_frame[:close_channel].to_s.to_sym) + end else end # if the_type == :text diff --git a/Services/www/www/gxg-www.rb b/Services/www/www/gxg-www.rb index d1cf1f5..09f0256 100644 --- a/Services/www/www/gxg-www.rb +++ b/Services/www/www/gxg-www.rb @@ -976,7 +976,7 @@ module GxGwww raise "Invalid Remote ID." end # Federation - the_channel = ::GxG::CHANNELS.create_channel(remote_uuid) + # the_channel = ::GxG::CHANNELS.create_channel(remote_uuid) # ??? # xxx unless the_display