more fedi tweaks

This commit is contained in:
Administrator 2025-09-01 19:04:45 -07:00
parent 4e7bce2423
commit 342635e967
2 changed files with 25 additions and 1 deletions

View file

@ -257,7 +257,7 @@ class WebSocketListener
the_display = the_socket.instance_variable_get(:@display)
#
if the_display
the_manifest = GxG::SERVICES[:www][:manifests][(the_session)]
the_manifest = GxG::SERVICES[:www][:manifests][(the_session['session_id'])]
if the_manifest
if the_manifest.display_exist?(the_display)
the_manifest.display_set(the_display, :available)
@ -271,6 +271,17 @@ class WebSocketListener
GxGwww::SOCKETS_SAFETY.synchronize {
GxGwww::SOCKETS.delete(the_uuid)
}
prune_list = []
::GxG::GXG_FEDERATION_SAFETY.synchronize {
::GxG::GXG_FEDERATION[:connections].each_pair do |uuid, the_channel|
if the_socket == the_channel.socket
prune_list << uuid
end
end
}
prune_list.each do |uuid|
::GxG::CHANNELS.destroy_channel(uuid)
end
puts "Closing Socket #{the_uuid} & Display #{the_display}"
true
end

View file

@ -943,6 +943,7 @@ module GxGwww
else
raise Exception, "Channel #{the_uuid.to_s.to_sym.inspect} Not Found."
end
else
raise Exception, "Connector Not Found."
end
@ -974,6 +975,9 @@ module GxGwww
unless ::GxG::valid_uuid?(remote_uuid.to_s)
raise "Invalid Remote ID."
end
# Federation
the_channel = ::GxG::CHANNELS.create_channel(remote_uuid)
# ???
# xxx
unless the_display
# Expire old Displays and set to :available
@ -1344,6 +1348,15 @@ module GxGwww
# Callable Toolbox
def set_socket_uuid(the_uuid)
@socket = the_uuid
socket_channel = ::GxG::CHANNELS.fetch_channel(@socket.to_s.to_sym)
display_channel = ::GxG::CHANNELS.fetch_channel(@remote_uuid.to_s.to_sym)
if socket_channel && display_channel
display_channel.socket = socket_channel.socket
display_channel.secret = socket_channel.secret
else
raise Exception.new("Failed to bind display and socket")
end
true
end
#
def admin_get_roles()