diff --git a/www/common/common-messaging.js b/www/common/common-messaging.js index ffb0fe75e..8a846482a 100644 --- a/www/common/common-messaging.js +++ b/www/common/common-messaging.js @@ -60,6 +60,7 @@ define([ common.whenRealtimeSyncs(common.getRealtime(), cb); }; + // TODO set this up as an observable data structure var getFriendList = Msg.getFriendList = function (common) { var proxy = common.getProxy(); if (!proxy.friends) { proxy.friends = {}; } @@ -83,6 +84,132 @@ define([ var channels = Msg.channels = window.channels = {}; var UI = Msg.UI = {}; + + // TODO extract into UI method + var createChatBox = function (common, $container, curvePublic, ui) { + var data = getFriend(common, curvePublic); + + // Input + var channel = channels[data.channel]; + + var $header = $('