mirror of
https://github.com/mistergibson/gxg-web-client.git
synced 2026-08-15 03:26:00 -07:00
more fedi tweaks
This commit is contained in:
parent
2f6cf12ddd
commit
ecc5c7257e
2 changed files with 17 additions and 5 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue