federation fixes

This commit is contained in:
Administrator 2025-09-05 17:44:23 -07:00
parent 342635e967
commit 19f4a1b3f2
2 changed files with 14 additions and 1 deletions

View file

@ -223,6 +223,19 @@ class WebSocketListener
if op_frame[:payload] 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}))) the_channel.send_message(::GxG::Events::Message::import(JSON.parse(op_frame[:payload].to_s.decode64.decrypt(the_secret), {:symbolize_names => true})))
end 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 else
end end
# if the_type == :text # if the_type == :text

View file

@ -976,7 +976,7 @@ module GxGwww
raise "Invalid Remote ID." raise "Invalid Remote ID."
end end
# Federation # Federation
the_channel = ::GxG::CHANNELS.create_channel(remote_uuid) # the_channel = ::GxG::CHANNELS.create_channel(remote_uuid)
# ??? # ???
# xxx # xxx
unless the_display unless the_display