From bba8bffa4d0d856b5efe1e024a61374aa1251084 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Fri, 1 Mar 2013 17:44:34 +0100 Subject: [PATCH] contact status --- README.md | 3 ++ chromesoul.css | 4 +++ img/status/contact-away.png | Bin 0 -> 2893 bytes img/status/contact-connected.png | Bin 0 -> 2896 bytes img/status/contact-disconnected.png | Bin 0 -> 2892 bytes img/status/contact-dnd.png | Bin 0 -> 2896 bytes img/status/me-away.png | Bin 0 -> 3883 bytes img/status/me-disconnected.png | Bin 4039 -> 4016 bytes img/status/me-dnd.png | Bin 0 -> 3849 bytes lib/client.js | 9 +++++- lib/contacts.nsui.js | 41 ++++++++++++++++++++++++++-- lib/ns_client.js | 21 ++++---------- 12 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 img/status/contact-away.png create mode 100644 img/status/contact-connected.png create mode 100644 img/status/contact-disconnected.png create mode 100644 img/status/contact-dnd.png create mode 100644 img/status/me-away.png create mode 100644 img/status/me-dnd.png diff --git a/README.md b/README.md index 6ef9afb..e7b2b43 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,9 @@ There's a few bugs with avatars, however it works. ### State change It's on it's way. +### Contact's status +A status indicator is available next to the contact's avatar. + ### File transfer Maybe later. diff --git a/chromesoul.css b/chromesoul.css index f70758b..e9c9c66 100644 --- a/chromesoul.css +++ b/chromesoul.css @@ -87,6 +87,10 @@ body { font-family: monospace; } +#contact-lst > li > span { + padding-left: 5px; +} + .remove { float: right; font-family: sans-serif; diff --git a/img/status/contact-away.png b/img/status/contact-away.png new file mode 100644 index 0000000000000000000000000000000000000000..bb151e4ffe391ad8d3dcf5880e6959f52a43c03a GIT binary patch literal 2893 zcmV-T3$pZyP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S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~b8+ydETEn#{}Rrn$Gl1n{w{s>1-v z^gx|J5gC8mh^0q0GOMiIK2OELH*xub>mGLL=1FQ^ndnr6%ONk=3XqX*L6=dwVe*o2 zR$fELRaG_CUHqD7ZR+#24Hh^xGtrX|S-yFi%%hpE+R)S&`P>qys4L|9Yrw{{rm4pp z{H%zx<~*54GauB3rY>a%+TPRG+l=D&VWc9YA`>L$!fT$?(7S6xQ+>IAWGhHE9^vu( t`VnBCeE%8;27rOu(3GCPwB^db0|06Wq?}jxG#3B>002ovPDHLkV1i6hO(FmQ literal 0 HcmV?d00001 diff --git a/img/status/me-disconnected.png b/img/status/me-disconnected.png index 47ecb3c4d9ac93b3154c03ea4336413701664eeb..73043b6e5fc027f4307e448764e6ece72c9a58a6 100644 GIT binary patch delta 1281 zcmV+c1^)WSAFv;=zzTocNkldf@Iuw%}fd1FTh*COTf#(N5K6en;+cx*=bHuNF$x^OsrLqgW_<~Pdd z>jnQ4sVjcNa5yaH=H@UAgN20!R##VPY-|Mh78r9J2Srg_2T@j5Rth1`DT*?x>pHrw zbMW9n8XFr~U0r2iVFAN1Fbsp<-d>I#JzCXz1*LyNX^?O@e6gjaCTao0eEggD#M(sE&Vco^HZ85tQNli6JTXEGT^MnBPN#{*VyLQ0C=_CHa*|pLtHOVz zPuG9-4R`eQ_0inijA@!oO-%tXH8q84nlv>v5exHQ*D(yk4UTmI40yfXO{H6Z ze?LM95{U%Yu3aOMNFapZ^y$+yH8pM6dc9tf$)p<~ivnmb4$jurR{VZHj^l9s`gI(~ z!SDCe+Pb+m@_0NfE-tzOG9!TfGEZ!huC9MB8X6jK9EXO62D-Ysw%FviwhQvL0PdBV zEEbEA&1O*)g={uUEEd~hQ;_Uxtw$yWFk_nL=IS<;A|8*UC<>jOohXVzJRT>NN^N%R z;vyc8r&f^HRaJc;fGdRoXIU0wV`JoUIeb1J-QC^zd_Hoy99OSir7#mGlS$gz+8%$( zSXRVVYs^SEIcpLTR~plKT8J?qr z@pwEeEiG~8%$W`U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Q&X6$swk?h1)#9D zmWjbZd~P=*PA6MhTbcBF@pW~vv9a-pJdKBB<$NK_LP+Xk?bda&4fRBn_+CXhl4-G= z-{Nu+93N-&+&PL*okC<~MO4<|rY3(Z$Btpl&*$&@dS*sPk8Znl>-(rhGzpZ@aUtB- zplKSKrg6Kx+;O+2Mtkh>XwRQNk9$4#c(l7UHQMd+az}Ws9@mn)Z+2-Z#{7JOfdErp zFTR^MUslpk=!>2G{pVNg7!W>>@aq4%0u;*sUmoBRaA{|Me+ZrB{{aBBfjkl3%lJ*8 P00000NkvXXu0mjfv&4TO diff --git a/img/status/me-dnd.png b/img/status/me-dnd.png new file mode 100644 index 0000000000000000000000000000000000000000..3fb06335470151bec4702f7ba144801c2c7d13c0 GIT binary patch literal 3849 zcmV+k5BBhhP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrW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2U=VLG zXxoB5F+pJ8zPs``nnlNxqH*!P_-oJvE@+xIUTB_2^xiCA^2E7wCuBFC zmmA)bWg#!;%QeNX%FodBy2`pe6dHQEipqL(aF9EgQzyGiA26o8*ztX@cFxr+%<=45^q5Lxdj@jNdegwbb00000 LNkvXXu0mjf-|Zu& literal 0 HcmV?d00001 diff --git a/lib/client.js b/lib/client.js index c88102f..1065dca 100644 --- a/lib/client.js +++ b/lib/client.js @@ -21,6 +21,7 @@ var Client = function() { this.ui = null; this.status = null; this.contacts = []; + this.waiting_contacts = []; }; Client.prototype.createSocket = function() { @@ -44,6 +45,7 @@ Client.prototype.connect = function() { if (elem.is_connected) { elem.daemonize(); elem.changeStatus(); + elem.addContact(); } else { elem.disconnect(); } @@ -94,8 +96,13 @@ Client.prototype.updateStatus = function() { }; Client.prototype.addContact = function(name) { + if (typeof name !== 'undefined') { + this.waiting_contacts.push(name); + } if (this.is_connected) { - this.client.addContact(this, name); + var tmp = this.waiting_contacts; + this.waiting_contacts = []; + this.client.addContact(this, tmp); } }; diff --git a/lib/contacts.nsui.js b/lib/contacts.nsui.js index ee09a53..5e16a47 100644 --- a/lib/contacts.nsui.js +++ b/lib/contacts.nsui.js @@ -16,7 +16,7 @@ var ContactList = function() { this.storage = chrome.storage.sync; - this.contacts = {}; // {: {name: , li: , avatar: }} + this.contacts = {}; // {: {name: , li: , img: , avatar: }} this.lst = document.getElementById("contact-lst"); }; @@ -52,11 +52,14 @@ ContactList.prototype.addContact = function(name) { $cs.avatars.get(infos.name, function(url) { li.style.backgroundImage = "url('" + url + "')"; }); + img = document.createElement("img"); + this.setImageStatus(img, "offline"); login = document.createElement("span"); close = document.createElement("span"); close.classList.add("remove"); login.innerHTML = name; close.innerHTML = 'x'; + li.appendChild(img); li.appendChild(login); li.appendChild(close); li.addEventListener("dblclick", function() { @@ -72,6 +75,7 @@ ContactList.prototype.addContact = function(name) { })(this)); infos.li = li; + infos.img = img; this.contacts[name] = infos; this.save(); this.insertContact(infos); @@ -87,8 +91,41 @@ ContactList.prototype.rmContact = function(name) { } }; +ContactList.prototype.setImageStatus = function(img, status) { + var status_list = {'default' : 'img/status/contact-connected.png', + + 'offline': 'img/status/contact-disconnected.png', + 'disconnected': 'img/status/contact-disconnected.png', + 'deconnecte': 'img/status/contact-disconnected.png', + 'deco': 'img/status/contact-disconnected.png', + 'hidden': 'img/status/contact-disconnected.png', + 'cache': 'img/status/contact-disconnected.png', + + 'away': 'img/status/contact-away.png', + 'inactif': 'img/status/contact-away.png', + 'absent': 'img/status/contact-away.png', + 'idle': 'img/status/contact-away.png', + + 'dnd': 'img/status/contact-dnd.png', + 'occuped': 'img/status/contact-dnd.png', + 'npd': 'img/status/contact-dnd.png', + 'occupe': 'img/status/contact-dnd.png' + }; + + if (status_list.hasOwnProperty(status)) { + img.src = status_list[status]; + } else { + img.src = status_list.default; + } + img.alt = status; + img.title = status; +}; + ContactList.prototype.changeContactStatus = function(name, status) { - console.log(name + ' changed his status to ' + status); + if (typeof this.contacts[name] !== "undefined") { + this.setImageStatus(this.contacts[name].img, status); + console.log(name + ' changed his status to ' + status); + } }; ContactList.prototype.save = function() { diff --git a/lib/ns_client.js b/lib/ns_client.js index 5fd13b9..48b8d0a 100644 --- a/lib/ns_client.js +++ b/lib/ns_client.js @@ -60,7 +60,7 @@ var NsClient = function() { return false; } - $cs.contacts.changeContactStatus(mch[2], this.msgDecode(mch[6])); // TODO: FIX ME! + $cs.contacts.changeContactStatus(mch[2], elem.msgDecode(mch[6])); // TODO: FIX ME! return true; }; @@ -90,7 +90,7 @@ var NsClient = function() { return false; } - $cs.contacts.changeContactStatus(mch[7], this.msgDecode(mch[16])); // TODO: FIX ME! + $cs.contacts.changeContactStatus(mch[7], elem.msgDecode(mch[16])); // TODO: FIX ME! return true; }; @@ -157,7 +157,6 @@ NsClient.prototype.changeStatus = function(client) { }; NsClient.prototype.recv = function(client, data) { - console.log('Debug: ' + data); // TODO: REMOVE ME! for (var i = this.actions_enabled.length - 1; i >= 0; --i) { if (this.action[this.actions_enabled[i]](client, data)) { break; @@ -165,30 +164,22 @@ NsClient.prototype.recv = function(client, data) { } }; -NsClient.prototype.addContact = function(client, name) { - // TODO -}; - -NsClient.prototype.rmContact = function(client, name) { - // TODO -}; - NsClient.prototype.speak = function(client, to, msg) { msg = 'user_cmd msg_user ' + to + ' msg ' + this.msgEncode(msg) + '\n'; client.socket.write(msg, function(inf) {}); }; -NsClient.prototype.addContact = function(client, name) { - var msg = 'user_cmd watch_log_user {' + name + '}\n'; +NsClient.prototype.addContact = function(client, lst) { + var msg = 'user_cmd watch_log_user {' + lst.join(',') + '}\n'; client.socket.write(msg, function(inf) { - var msg = 'user_cmd who {' + name + '}\n'; - console.log('stalking ' + name + ': ' + msg); + var msg = 'user_cmd who {' + lst.join(',') + '}\n'; client.socket.write(msg, function(inf) {}); }); }; NsClient.prototype.rmContact = function(client, name) { + // TODO }; NsClient.prototype.replacePairs = function(str, pairs) {