Permalink
Browse files

Comply with how javascript bindings work now

  • Loading branch information...
o-jasper committed Oct 19, 2015
1 parent b76b465 commit e225b0d30a9741f819feb30f01da046c996687a2
Showing with 35 additions and 41 deletions.
  1. +4 −8 tox_client/Aliasses.lua
  2. +14 −18 tox_client/Chat.lua
  3. +17 −15 tox_client/Contacts.lua
View
@@ -12,15 +12,11 @@ end
Page.rpc_js = {}
function Page.rpc_js:tox_addrs()
return function()
print(self.edge_toxes)
local ret = {}
for _, el in ipairs(self.edge_toxes) do
print(el:addr())
table.insert(ret, el:addr())
end
return ret
local ret = {}
for _, el in ipairs(self.edge_toxes) do
table.insert(ret, el:addr())
end
return ret
end
return Page
View
@@ -17,26 +17,22 @@ Page.rpc_js = {}
local ret_list = require "tox_client.lib.ret_list"
local info_on = require "page_html.info_on"
function Page.rpc_js:chat_html_list()
return function (fa, ta, state)
local edge = self.edgechat:ensure_edge(fa, ta)
local list = edge:list_events_after(state.after_time or 0)
state.repl = require "tox_client.repl_package"
state.self = self
state.fa = fa
state.ta = ta
local info_list = info_on.list(list, state, self.info_ons)
state.where = self.where
return ret_list(info_list, state)
end
function Page.rpc_js:chat_html_list(fa, ta, state)
local edge = self.edgechat:ensure_edge(fa, ta)
local list = edge:list_events_after(state.after_time or 0)
state.repl = require "tox_client.repl_package"
state.self = self
state.fa = fa
state.ta = ta
local info_list = info_on.list(list, state, self.info_ons)
state.where = self.where
return ret_list(info_list, state)
end
function Page.rpc_js:send_chat()
return function(fa, ta, kind, text)
self.edgechat:ensure_edge(fa, ta):do_msg(nil, kind, text)
end
function Page.rpc_js:send_chat(fa, ta, kind, text)
self.edgechat:ensure_edge(fa, ta):do_msg(nil, kind, text)
end
return Page
View
@@ -18,22 +18,24 @@ Page.rpc_js = {}
local ret_list = require "tox_client.lib.ret_list"
local info_on = require "page_html.info_on"
function Page.rpc_js:contact_html_list()
return function (fa, state)
local list = {}
for ta, edge in pairs(self.edgechat:ensure_from(fa)) do
local ret = { fa = fa, ta = ta }
for k,v in pairs(edge) do ret[k] = v end
table.insert(list, ret)
end
state.repl = require "tox_client.repl_package"
state.self = self
local info_list = info_on.list(list, state, self.info_ons)
state.where = self.where
return ret_list(info_list, state)
function Page.rpc_js:contact_html_list(fa,state)
local list = {}
for ta, edge in pairs(self.edgechat:ensure_from(fa)) do
local ret = { fa = fa, ta = ta }
for k,v in pairs(edge) do ret[k] = v end
table.insert(list, ret)
end
state.repl = require "tox_client.repl_package"
state.self = self
local info_list = info_on.list(list, state, self.info_ons)
state.where = self.where
return ret_list(info_list, state)
end
function Page.rpc_js:add_contact(fa, state)
-- TODO
end
return Page

0 comments on commit e225b0d

Please sign in to comment.