[kune-commits] r1446 - in trunk: . src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/chat/client/actions/conditions src/main/java/cc/kune/common/client/ui src/main/java/cc/kune/core/client src/main/java/cc/kune/core/client/avatar src/main/java/cc/kune/core/client/resources src/main/java/cc/kune/core/client/sitebar/spaces src/main/java/cc/kune/core/client/sn src/main/java/cc/kune/core/client/sn/actions/conditions src/main/java/cc/kune/core/client/sn/actions/registry src/main/java/cc/kune/core/client/ws/entheader src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/wave/client

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sun Jul 10 20:29:52 CEST 2011


Author: vjrj_
Date: 2011-07-10 20:29:52 +0200 (Sun, 10 Jul 2011)
New Revision: 1446

Added:
   trunk/src/main/java/cc/kune/chat/client/AvatarDecoratorImpl.java
   trunk/src/main/java/cc/kune/chat/client/ChatInstances.java
   trunk/src/main/java/cc/kune/chat/client/MediumAvatarDecoratorImpl.java
   trunk/src/main/java/cc/kune/chat/client/SmallAvatarDecoratorImpl.java
   trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithThisPersonAction.java
   trunk/src/main/java/cc/kune/chat/client/actions/conditions/
   trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java
   trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java
   trunk/src/main/java/cc/kune/common/client/ui/AbstractDecorator.java
   trunk/src/main/java/cc/kune/common/client/ui/AbstractDecorator.ui.xml
   trunk/src/main/java/cc/kune/core/client/avatar/
   trunk/src/main/java/cc/kune/core/client/avatar/AvatarDecorator.java
   trunk/src/main/java/cc/kune/core/client/avatar/MediumAvatarDecorator.java
   trunk/src/main/java/cc/kune/core/client/avatar/SmallAvatarDecorator.java
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-available-medium.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-available-small.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-away-medium.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-away-small.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-busy-medium.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-busy-small.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-extended-away-medium.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-extended-away-small.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-invisible-medium.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-invisible-small.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-offline-medium.png
   trunk/src/main/java/cc/kune/core/client/resources/chat-dot-offline-small.png
Removed:
   trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithUserAction.java
Modified:
   trunk/
   trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
   trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java
   trunk/src/main/java/cc/kune/chat/client/ChatOptions.java
   trunk/src/main/java/cc/kune/chat/client/ChatParts.java
   trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
   trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java
   trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java
   trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
   trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithMemberAction.java
   trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
   trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
   trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml
   trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsMeCondition.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotMeCondition.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java
   trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
   trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
   trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityTextLogo.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
   trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
Log:
Avatar of buddies with status; Several fixes in chat


Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
   - pmd-eclipse.log
.pmd
www-test
screenlog.0
client
public
target
target-local
Main-compile
.settings
.gwt-cache
repository
derby.log
star-yellow-grey.png
run.sh
tomcat
gwt-out
synccss.sh
.externalToolBuilders
.wtpmodules
www
testRepository
kune-OLD-jcr
KuneApp.launch
KuneApp NOSERVER.launch
old_src
org.ourproject.kune.app.Kune
org.ourproject.kune.iml
org.ourproject.kune.ipr
org.ourproject.kune.iws
nbproject
hibernate.reveng.xml
.gwt-tmp
target-eclipse
.checkstyle
.classpath-bien
pom.xml.*
.gwt
.jdee_sources
.jdee_classpath
prj.el
.factorypath
.apt_generated
target.old
_accounts
_certificates
_deltas
logs

test-output

   + pmd-eclipse.log
.pmd
www-test
screenlog.0
client
public
target
target-local
Main-compile
.settings
.gwt-cache
repository
derby.log
star-yellow-grey.png
run.sh
tomcat
gwt-out
synccss.sh
.externalToolBuilders
.wtpmodules
www
testRepository
kune-OLD-jcr
KuneApp.launch
KuneApp NOSERVER.launch
old_src
org.ourproject.kune.app.Kune
org.ourproject.kune.iml
org.ourproject.kune.ipr
org.ourproject.kune.iws
nbproject
hibernate.reveng.xml
.gwt-tmp
target-eclipse
.checkstyle
.classpath-bien
pom.xml.*
.gwt
.jdee_sources
.jdee_classpath
prj.el
.factorypath
.apt_generated
target.old
_accounts
_certificates
_deltas
logs
test-output
.recommenders


Added: trunk/src/main/java/cc/kune/chat/client/AvatarDecoratorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/AvatarDecoratorImpl.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/AvatarDecoratorImpl.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,127 @@
+package cc.kune.chat.client;
+
+import cc.kune.common.client.ui.AbstractDecorator;
+import cc.kune.core.client.avatar.AvatarDecorator;
+
+import com.calclab.emite.core.client.events.StateChangedEvent;
+import com.calclab.emite.core.client.events.StateChangedHandler;
+import com.calclab.emite.core.client.xmpp.session.XmppSession;
+import com.calclab.emite.core.client.xmpp.stanzas.Presence.Show;
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+import com.calclab.emite.im.client.roster.RosterItem;
+import com.calclab.emite.im.client.roster.XmppRoster;
+import com.calclab.emite.im.client.roster.events.RosterItemChangedEvent;
+import com.calclab.emite.im.client.roster.events.RosterItemChangedHandler;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.gwt.event.logical.shared.AttachEvent;
+import com.google.gwt.event.logical.shared.AttachEvent.Handler;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.user.client.ui.IsWidget;
+
+public class AvatarDecoratorImpl extends AbstractDecorator implements AvatarDecorator {
+
+  private HandlerRegistration attachHandler;
+  private final ChatClient chatClient;
+  private final ImageResource chatDotAvailable;
+  private final ImageResource chatDotAway;
+  private final ImageResource chatDotBusy;
+  private final ImageResource chatDotExtendedAway;
+  private final ImageResource chatDotXA;
+  private final XmppRoster roster;
+  private final HandlerRegistration rosterHandler;
+  private final XmppSession session;
+  private final HandlerRegistration sessionStateChangedHandler;
+  private XmppURI uri;
+
+  public AvatarDecoratorImpl(final ChatInstances chatInstances, final ChatClient chatClient,
+      final ImageResource chatDotBusy, final ImageResource chatDotXA, final ImageResource chatDotAway,
+      final ImageResource chatDotExtendedAway, final ImageResource chatDotAvailable) {
+    this.chatClient = chatClient;
+    this.chatDotBusy = chatDotBusy;
+    this.chatDotXA = chatDotXA;
+    this.chatDotAway = chatDotAway;
+    this.chatDotExtendedAway = chatDotExtendedAway;
+    this.chatDotAvailable = chatDotAvailable;
+    session = chatInstances.xmppSession;
+    sessionStateChangedHandler = session.addSessionStateChangedHandler(false, new StateChangedHandler() {
+      @Override
+      public void onStateChanged(final StateChangedEvent event) {
+        refresh();
+      }
+    });
+    roster = chatInstances.roster;
+    rosterHandler = roster.addRosterItemChangedHandler(new RosterItemChangedHandler() {
+      @Override
+      public void onRosterItemChanged(final RosterItemChangedEvent event) {
+        final RosterItem item = event.getRosterItem();
+        if (item.getJID().equals(uri)) {
+          setIcon(item.isAvailable(), item.getShow(), item.getStatus());
+        }
+      }
+    });
+
+  }
+
+  private void clearDecorator() {
+    AvatarDecoratorImpl.this.clearImage();
+  }
+
+  private void refresh() {
+    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+      @Override
+      public void execute() {
+        if (uri != null) {
+          final RosterItem item = roster.getItemByJID(uri);
+          if (session.isReady() && item != null) {
+            setIcon(item.isAvailable(), item.getShow(), item.getStatus());
+          } else {
+            clearDecorator();
+          }
+        } else {
+          clearDecorator();
+        }
+      }
+    });
+  }
+
+  private void setIcon(final boolean available, final Show show, final String status) {
+    if (show == Show.dnd) {
+      super.setImage(chatDotBusy);
+    } else if (show == Show.xa) {
+      super.setImage(chatDotXA);
+    } else if (show == Show.away) {
+      super.setImage(chatDotAway);
+    } else if (show == Show.chat) {
+      super.setImage(chatDotExtendedAway);
+    } else if (available) {
+      super.setImage(chatDotAvailable);
+    } else {
+      clearDecorator();
+    }
+    super.setImageTooltip(status);
+  }
+
+  @Override
+  public void setItem(final String name) {
+    this.uri = (name != null ? chatClient.uriFrom(name) : null);
+    refresh();
+  }
+
+  @Override
+  public void setWidget(final IsWidget widget) {
+    super.setWidget(widget);
+    attachHandler = widget.asWidget().addAttachHandler(new Handler() {
+      @Override
+      public void onAttachOrDetach(final AttachEvent event) {
+        if (!event.isAttached()) {
+          rosterHandler.removeHandler();
+          sessionStateChangedHandler.removeHandler();
+          attachHandler.removeHandler();
+        }
+      }
+    });
+  }
+
+}

Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -55,7 +55,6 @@
 import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
 import com.calclab.emite.im.client.chat.ChatManager;
 import com.calclab.emite.im.client.roster.XmppRoster;
-import com.calclab.emite.reconnect.client.SessionReconnect;
 import com.calclab.emite.xep.avatar.client.AvatarManager;
 import com.calclab.emite.xep.muc.client.Room;
 import com.calclab.emite.xep.muc.client.RoomManager;
@@ -69,7 +68,6 @@
 import com.calclab.hablar.icons.alt.client.AltIconsBundle;
 import com.calclab.hablar.login.client.HablarLogin;
 import com.calclab.hablar.login.client.LoginConfig;
-import com.calclab.suco.client.Suco;
 import com.extjs.gxt.ui.client.Style.Scroll;
 import com.extjs.gxt.ui.client.widget.Dialog;
 import com.google.gwt.core.client.GWT;
@@ -112,7 +110,9 @@
   private static final String CHAT_TITLE = "Chat ;)";
 
   private final ChatClientAction action;
+  private final AvatarManager avatarManager;
   protected IconLabelDescriptor chatIcon;
+  private final ChatInstances chatInstances;
   private final ChatManager chatManager;
   private final ChatOptions chatOptions;
   private final ChatResources chatResources;
@@ -122,7 +122,9 @@
   private final RoomManager roomManager;
   private final XmppRoster roster;
   private final Session session;
+
   private final GlobalShortcutRegister shorcutRegister;
+
   private final SitebarActions siteActions;
 
   private final XmppSession xmppSession;
@@ -131,10 +133,10 @@
   public ChatClientDefault(final EventBus eventBus, final I18nTranslationService i18n,
       final SitebarActions siteActions, final Session session,
       final GlobalShortcutRegister shorcutRegister, final ChatOptions chatOptions,
-      final ChatResources chatResources) {
-
+      final ChatResources chatResources, final ChatInstances chatInstances) {
     this.eventBus = eventBus;
     this.i18n = i18n;
+    this.chatInstances = chatInstances;
     action = new ChatClientAction(eventBus, chatResources);
     this.siteActions = siteActions;
     this.session = session;
@@ -142,11 +144,13 @@
     this.chatOptions = chatOptions;
     this.chatResources = chatResources;
     chatResources.css().ensureInjected();
-    this.xmppSession = Suco.get(XmppSession.class);
-    this.roster = Suco.get(XmppRoster.class);
-    this.chatManager = Suco.get(ChatManager.class);
-    this.roomManager = Suco.get(RoomManager.class);
-    Suco.get(SessionReconnect.class);
+    this.xmppSession = chatInstances.xmppSession;
+    this.roster = chatInstances.roster;
+    this.chatManager = chatInstances.chatManager;
+    this.roomManager = chatInstances.roomManager;
+    this.avatarManager = chatInstances.avatarManager;
+    // Not necessary, in ChatInstance
+    // Suco.get(SessionReconnect.class);
 
     session.onAppStart(true, new AppStartEvent.AppStartHandler() {
       @Override
@@ -305,7 +309,7 @@
     final KuneHablarWidget widget = new KuneHablarWidget(config.layout, config.tabHeaderSize);
     final Hablar hablar = widget.getHablar();
     HablarComplete.install(hablar, config);
-    new KuneHablarSignals(eventBus, xmppSession, hablar, action);
+    new KuneHablarSignals(eventBus, xmppSession, hablar, action, chatInstances);
     if (htmlConfig.hasLogger) {
       new HablarConsole(hablar);
     }
@@ -414,7 +418,7 @@
 
   @Override
   public void setAvatar(final String photoBinary) {
-    Suco.get(AvatarManager.class).setVCardAvatar(photoBinary);
+    avatarManager.setVCardAvatar(photoBinary);
   }
 
   private void setSize(final Widget widget, final HtmlConfig htmlConfig) {
@@ -455,6 +459,6 @@
 
   @Override
   public XmppURI uriFrom(final String shortName) {
-    return XmppURI.jid(shortName + "@" + chatOptions.domain);
+    return chatOptions.uriFrom(shortName);
   }
 }

Modified: trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -22,11 +22,11 @@
 import cc.kune.chat.client.actions.AddAsBuddieHeaderButton;
 import cc.kune.chat.client.actions.ChatClientActions;
 import cc.kune.chat.client.actions.ChatSitebarActions;
+import cc.kune.common.client.ExtendedGinModule;
+import cc.kune.core.client.avatar.MediumAvatarDecorator;
+import cc.kune.core.client.avatar.SmallAvatarDecorator;
 
-import com.google.inject.Singleton;
-import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
-
-public class ChatGinModule extends AbstractPresenterModule {
+public class ChatGinModule extends ExtendedGinModule {
   /*
    * (non-Javadoc)
    * 
@@ -34,12 +34,15 @@
    */
   @Override
   protected void configure() {
-    bind(ChatClient.class).to(ChatClientDefault.class).in(Singleton.class);
-    bind(ChatOptions.class).in(Singleton.class);
-    bind(ChatSitebarActions.class).in(Singleton.class);
-    bind(AddAsBuddieHeaderButton.class).in(Singleton.class);
-    // bind(OpenGroupPublicChatRoomButton.class).in(Singleton.class);
-    bind(ChatClientTool.class).in(Singleton.class);
-    bind(ChatClientActions.class).in(Singleton.class);
+    s(ChatInstances.class);
+    bind(SmallAvatarDecorator.class).to(SmallAvatarDecoratorImpl.class);
+    bind(MediumAvatarDecorator.class).to(MediumAvatarDecoratorImpl.class);
+    s(ChatClient.class, ChatClientDefault.class);
+    s(ChatOptions.class);
+    s(ChatSitebarActions.class);
+    s(AddAsBuddieHeaderButton.class);
+    // bind(OpenGroupPublicChatRoomButton.class);
+    s(ChatClientTool.class);
+    s(ChatClientActions.class);
   }
 }

Added: trunk/src/main/java/cc/kune/chat/client/ChatInstances.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatInstances.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/ChatInstances.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,34 @@
+package cc.kune.chat.client;
+
+import com.calclab.emite.core.client.xmpp.session.XmppSession;
+import com.calclab.emite.im.client.chat.ChatManager;
+import com.calclab.emite.im.client.presence.PresenceManager;
+import com.calclab.emite.im.client.roster.XmppRoster;
+import com.calclab.emite.reconnect.client.SessionReconnect;
+import com.calclab.emite.xep.avatar.client.AvatarManager;
+import com.calclab.emite.xep.muc.client.RoomManager;
+import com.calclab.emite.xep.storage.client.PrivateStorageManager;
+import com.calclab.suco.client.Suco;
+
+public class ChatInstances {
+
+  public AvatarManager avatarManager;
+  public ChatManager chatManager;
+  public PresenceManager presenceManager;
+  public PrivateStorageManager privateStorageManager;
+  public RoomManager roomManager;
+  public XmppRoster roster;
+  public SessionReconnect sessionReconnect;
+  public XmppSession xmppSession;
+
+  public ChatInstances() {
+    this.xmppSession = Suco.get(XmppSession.class);
+    this.roster = Suco.get(XmppRoster.class);
+    this.chatManager = Suco.get(ChatManager.class);
+    this.roomManager = Suco.get(RoomManager.class);
+    this.sessionReconnect = Suco.get(SessionReconnect.class);
+    this.avatarManager = Suco.get(AvatarManager.class);
+    this.presenceManager = Suco.get(PresenceManager.class);
+    this.privateStorageManager = Suco.get(PrivateStorageManager.class);
+  }
+}

Modified: trunk/src/main/java/cc/kune/chat/client/ChatOptions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatOptions.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/ChatOptions.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -22,11 +22,15 @@
 import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
 
 public class ChatOptions {
-    public String domain;
-    public String httpBase;
-    public String passwd;
-    public String resource;
-    public String roomHost;
-    public String username;
-    public XmppURI useruri;
+  public String domain;
+  public String httpBase;
+  public String passwd;
+  public String resource;
+  public String roomHost;
+  public String username;
+  public XmppURI useruri;
+
+  public XmppURI uriFrom(final String shortName) {
+    return XmppURI.jid(shortName + "@" + domain);
+  }
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/chat/client/ChatParts.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatParts.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/ChatParts.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -27,7 +27,9 @@
 import cc.kune.chat.client.actions.StartAssemblyWithMembers;
 import cc.kune.chat.client.actions.StartChatWithMemberAction;
 import cc.kune.chat.client.actions.StartChatWithThisBuddieAction;
-import cc.kune.chat.client.actions.StartChatWithUserAction;
+import cc.kune.chat.client.actions.StartChatWithThisPersonAction;
+import cc.kune.chat.client.actions.conditions.IsBuddieCondition;
+import cc.kune.chat.client.actions.conditions.IsNotBuddieCondition;
 import cc.kune.chat.shared.ChatConstants;
 import cc.kune.common.client.actions.AbstractAction;
 import cc.kune.common.client.actions.PropertyChangeEvent;
@@ -68,10 +70,12 @@
       final Provider<UserSNMenuItemsRegistry> userItemsRegistry, final IsNotMeCondition isNotMe,
       final IsCurrentStateAdministrableCondition isAdministrableCondition,
       final IsCurrentStateEditableCondition isEditableCondition,
+      final IsBuddieCondition isBuddieCondition, final IsNotBuddieCondition isNotBuddieCondition,
       final IsCurrentStateAGroupCondition isGroupCondition, final IsPersonCondition isPersonCondition,
       final Provider<AddAsBuddieAction> addAsBuddie,
       final Provider<StartChatWithMemberAction> startChatWithMemberAction,
-      final IsLoggedCondition isLogged, final Provider<StartChatWithUserAction> startChatWithUserAction,
+      final IsLoggedCondition isLogged,
+      final Provider<StartChatWithThisPersonAction> startChatWithPersonAction,
       final Provider<StartChatWithThisBuddieAction> startChatWithBuddieAction,
       final ChatClientActions chatActions, final Provider<StartAssemblyWithMembers> startAssembly,
       final Provider<OpenGroupPublicChatRoomAction> openGroupRoomAction,
@@ -99,6 +103,7 @@
           public MenuItemDescriptor get() {
             final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithBuddieAction.get());
             item.add(isLogged);
+            item.add(isBuddieCondition);
             item.add(isPersonCondition);
             return item;
           }
@@ -109,6 +114,7 @@
             final AddAsBuddieAction action = addAsBuddie.get();
             final MenuItemDescriptor item = new MenuItemDescriptor(action);
             item.add(isNotMe);
+            item.add(isNotBuddieCondition);
             item.add(isLogged);
             item.add(isPersonCondition);
             /**
@@ -125,21 +131,27 @@
             return item;
           }
         };
-        final Provider<MenuItemDescriptor> startChatWithUserItem = new Provider<MenuItemDescriptor>() {
+        final Provider<MenuItemDescriptor> startChatWithPersonItem = new Provider<MenuItemDescriptor>() {
           @Override
           public MenuItemDescriptor get() {
-            final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithUserAction.get());
+            final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithPersonAction.get());
             item.add(isNotMe);
             item.add(isLogged);
             item.add(isPersonCondition);
+            item.add(isNotBuddieCondition);
             return item;
           }
         };
 
         snAdminsRegistry.get().add(startChatWithMemberItem);
         snCollabsItemsRegistry.get().add(startChatWithMemberItem);
-        snPendingItemsRegistry.get().add(startChatWithUserItem);
+        snPendingItemsRegistry.get().add(startChatWithPersonItem);
+        snAdminsRegistry.get().add(startChatWithBuddieItem);
+        snCollabsItemsRegistry.get().add(startChatWithBuddieItem);
+        snPendingItemsRegistry.get().add(startChatWithBuddieItem);
+
         userItemsRegistry.get().add(startChatWithBuddieItem);
+        userItemsRegistry.get().add(startChatWithPersonItem);
         userItemsRegistry.get().add(addAsBuddieItem);
         groupConfActions.get().add(startAssembly.get());
         buddieButton.get();

Modified: trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -34,7 +34,6 @@
 import com.calclab.hablar.signals.client.unattended.UnattendedPagesManager;
 import com.calclab.hablar.signals.client.unattended.UnattendedPresenter;
 import com.calclab.hablar.user.client.UserContainer;
-import com.calclab.suco.client.Suco;
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.Window;
@@ -71,9 +70,9 @@
   // FIXME: move to gin
   @SuppressWarnings("deprecation")
   public KuneHablarSignals(final EventBus kuneEventBus, final XmppSession session, final Hablar hablar,
-      final ChatClientAction action) {
+      final ChatClientAction action, final ChatInstances chatInstances) {
     final HablarEventBus hablarEventBus = hablar.getEventBus();
-    final PrivateStorageManager storageManager = Suco.get(PrivateStorageManager.class);
+    final PrivateStorageManager storageManager = chatInstances.privateStorageManager;
 
     final HasText titleDisplay = new HasText() {
       @Override

Added: trunk/src/main/java/cc/kune/chat/client/MediumAvatarDecoratorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/MediumAvatarDecoratorImpl.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/MediumAvatarDecoratorImpl.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,17 @@
+package cc.kune.chat.client;
+
+import cc.kune.core.client.avatar.MediumAvatarDecorator;
+import cc.kune.core.client.resources.CoreResources;
+
+import com.google.inject.Inject;
+
+public class MediumAvatarDecoratorImpl extends AvatarDecoratorImpl implements MediumAvatarDecorator {
+
+  @Inject
+  public MediumAvatarDecoratorImpl(final CoreResources res, final ChatInstances chatInstances,
+      final ChatClient chatClient) {
+    super(chatInstances, chatClient, res.chatDotBusyMedium(), res.chatDotAwayMedium(),
+        res.chatDotAwayMedium(), res.chatDotExtendedAwayMedium(), res.chatDotAvailableMedium());
+    setImagePosition(53, -6, -10);
+  }
+}

Added: trunk/src/main/java/cc/kune/chat/client/SmallAvatarDecoratorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/SmallAvatarDecoratorImpl.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/SmallAvatarDecoratorImpl.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,17 @@
+package cc.kune.chat.client;
+
+import cc.kune.core.client.avatar.SmallAvatarDecorator;
+import cc.kune.core.client.resources.CoreResources;
+
+import com.google.inject.Inject;
+
+public class SmallAvatarDecoratorImpl extends AvatarDecoratorImpl implements SmallAvatarDecorator {
+
+  @Inject
+  public SmallAvatarDecoratorImpl(final CoreResources res, final ChatInstances chatInstances,
+      final ChatClient chatClient) {
+    super(chatInstances, chatClient, res.chatDotBusySmall(), res.chatDotAwaySmall(),
+        res.chatDotAwaySmall(), res.chatDotExtendedAwaySmall(), res.chatDotAvailableSmall());
+    setImagePosition(23, -9, -8);
+  }
+}

Modified: trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -20,6 +20,7 @@
 package cc.kune.chat.client.actions;
 
 import cc.kune.chat.client.ChatClient;
+import cc.kune.chat.client.ChatInstances;
 import cc.kune.common.client.actions.AbstractAction;
 import cc.kune.common.client.actions.AbstractExtendedAction;
 import cc.kune.common.client.actions.Action;
@@ -38,10 +39,8 @@
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
-import com.calclab.emite.im.client.roster.XmppRoster;
 import com.calclab.emite.im.client.roster.events.RosterGroupChangedEvent;
 import com.calclab.emite.im.client.roster.events.RosterGroupChangedHandler;
-import com.calclab.suco.client.Suco;
 import com.google.inject.Inject;
 
 public class AddAsBuddieHeaderButton {
@@ -52,7 +51,8 @@
 
     @Inject
     public AddAsBuddieAction(final ChatClient chatEngine, final Session session,
-        final StateManager stateManager, final I18nTranslationService i18n, final CoreResources img) {
+        final ChatInstances chatInstances, final StateManager stateManager,
+        final I18nTranslationService i18n, final CoreResources img) {
       super();
       this.chatEngine = chatEngine;
       this.session = session;
@@ -62,7 +62,7 @@
           setState(event.getState());
         }
       });
-      Suco.get(XmppRoster.class).addRosterGroupChangedHandler(new RosterGroupChangedHandler() {
+      chatInstances.roster.addRosterGroupChangedHandler(new RosterGroupChangedHandler() {
 
         @Override
         public void onGroupChanged(final RosterGroupChangedEvent event) {

Modified: trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -20,6 +20,7 @@
 package cc.kune.chat.client.actions;
 
 import cc.kune.chat.client.ChatClient;
+import cc.kune.chat.client.ChatInstances;
 import cc.kune.chat.client.resources.ChatResources;
 import cc.kune.common.client.actions.AbstractAction;
 import cc.kune.common.client.actions.AbstractExtendedAction;
@@ -40,144 +41,151 @@
 import com.calclab.emite.im.client.presence.PresenceManager;
 import com.calclab.emite.im.client.presence.events.OwnPresenceChangedEvent;
 import com.calclab.emite.im.client.presence.events.OwnPresenceChangedHandler;
-import com.calclab.suco.client.Suco;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.inject.Inject;
 
 public class ChatSitebarActions {
 
-    public class ChangeOfflineStatusAction extends AbstractExtendedAction {
-        public ChangeOfflineStatusAction(final ImageResource icon) {
-            xmppSession.addSessionStateChangedHandler(true, new StateChangedHandler() {
-                @Override
-                public void onStateChanged(final StateChangedEvent event) {
-                    if (!xmppSession.isReady()) {
-                        SiteUserOptionsPresenter.LOGGED_USER_MENU.putValue(AbstractAction.SMALL_ICON, icon);
-                    }
-                }
-            });
-        }
+  public class ChangeOfflineStatusAction extends AbstractExtendedAction {
+    private final XmppSession session;
 
+    public ChangeOfflineStatusAction(final XmppSession session, final ImageResource icon) {
+      this.session = session;
+      session.addSessionStateChangedHandler(true, new StateChangedHandler() {
         @Override
-        public void actionPerformed(final ActionEvent event) {
-            // presenceManager.changeOwnPresence(Presence.build(NO_STATUS,
-            // Show.xa));
-            xmppSession.logout();
+        public void onStateChanged(final StateChangedEvent event) {
+          if (!session.isReady()) {
+            SiteUserOptionsPresenter.LOGGED_USER_MENU.putValue(AbstractAction.SMALL_ICON, icon);
+          }
         }
+      });
     }
-    public class ChangeOnlineStatusAction extends AbstractExtendedAction {
-        private final Presence thisPresence;
 
-        public ChangeOnlineStatusAction(final String statusText, final Show show, final ImageResource icon) {
-            thisPresence = Presence.build(statusText, show);
-            presenceManager.addOwnPresenceChangedHandler(new OwnPresenceChangedHandler() {
+    @Override
+    public void actionPerformed(final ActionEvent event) {
+      // presenceManager.changeOwnPresence(Presence.build(NO_STATUS,
+      // Show.xa));
+      session.logout();
+    }
+  }
+  public class ChangeOnlineStatusAction extends AbstractExtendedAction {
+    private final PresenceManager manager;
+    private final Presence thisPresence;
 
-                @Override
-                public void onOwnPresenceChanged(final OwnPresenceChangedEvent event) {
-                    updateStatusIcon(icon, event.getCurrentPresence());
-                }
+    public ChangeOnlineStatusAction(final PresenceManager presenceManager, final String statusText,
+        final Show show, final ImageResource icon) {
+      this.manager = presenceManager;
+      thisPresence = Presence.build(statusText, show);
+      presenceManager.addOwnPresenceChangedHandler(new OwnPresenceChangedHandler() {
 
-            });
-            updateStatusIcon(icon, presenceManager.getOwnPresence());
-        }
-
         @Override
-        public void actionPerformed(final ActionEvent event) {
-            if (!chatClient.loginIfNecessary()) {
-                presenceManager.changeOwnPresence(thisPresence);
-            }
-            nextPresence = thisPresence;
+        public void onOwnPresenceChanged(final OwnPresenceChangedEvent event) {
+          updateStatusIcon(icon, event.getCurrentPresence());
         }
 
-        private void updateStatusIcon(final ImageResource icon, final Presence currentPresence) {
-            if (thisPresence.getShow().equals(currentPresence.getShow())
-                    && ((currentPresence.getStatus() == null) || currentPresence.getStatus().equals(
-                            thisPresence.getStatus()))) {
-                SiteUserOptionsPresenter.LOGGED_USER_MENU.putValue(AbstractAction.SMALL_ICON, icon);
-            }
-        }
+      });
+      updateStatusIcon(icon, presenceManager.getOwnPresence());
     }
 
-    private static final String CHAT_STATUS = "k-chat-status-group";
-    private static final String GROUP_CHAT_STATUS = "k-group-chat-status";
-    private static final String NO_STATUS = null;
-    private final ChatClient chatClient;
-    private final I18nTranslationService i18n;
-    private Presence nextPresence = Presence.build(NO_STATUS, Show.notSpecified);
-    private final PresenceManager presenceManager = Suco.get(PresenceManager.class);
-    private final ChatResources res;
-    private final Session session;
-    private final SiteUserOptions userOptions;
-    private final XmppSession xmppSession = Suco.get(XmppSession.class);
+    @Override
+    public void actionPerformed(final ActionEvent event) {
+      if (!chatClient.loginIfNecessary()) {
+        manager.changeOwnPresence(thisPresence);
+      }
+      nextPresence = thisPresence;
+    }
 
-    @Inject
-    public ChatSitebarActions(final Session session, final ChatClient chatClient, final SiteUserOptions userOptions,
-            final I18nTranslationService i18n, final ChatResources res) {
-        this.session = session;
-        this.chatClient = chatClient;
-        this.userOptions = userOptions;
-        this.i18n = i18n;
-        this.res = res;
-        createActions();
+    private void updateStatusIcon(final ImageResource icon, final Presence currentPresence) {
+      if (thisPresence.getShow().equals(currentPresence.getShow())
+          && ((currentPresence.getStatus() == null) || currentPresence.getStatus().equals(
+              thisPresence.getStatus()))) {
+        SiteUserOptionsPresenter.LOGGED_USER_MENU.putValue(AbstractAction.SMALL_ICON, icon);
+      }
     }
+  }
 
-    private void createActions() {
-        final MenuTitleItemDescriptor chatActionsTitle = new MenuTitleItemDescriptor(
-                SiteUserOptionsPresenter.LOGGED_USER_MENU, i18n.t("Set your chat status"));
-        userOptions.addAction(new MenuSeparatorDescriptor(SiteUserOptionsPresenter.LOGGED_USER_MENU));
-        userOptions.addAction(chatActionsTitle);
-        final MenuRadioItemDescriptor onlineItem = createChatStatusAction(res.online(), i18n.t("Available"),
-                onlineAction(NO_STATUS, Show.notSpecified, res.online()));
-        final MenuRadioItemDescriptor availableItem = createChatStatusAction(res.xa(), i18n.t("Available for chat"),
-                onlineAction(NO_STATUS, Show.chat, res.xa()));
-        final MenuRadioItemDescriptor awayItem = createChatStatusAction(res.away(), i18n.t("Away"),
-                onlineAction(NO_STATUS, Show.away, res.away()));
-        final MenuRadioItemDescriptor busyItem = createChatStatusAction(res.busy(), i18n.t("Busy"),
-                onlineAction(NO_STATUS, Show.dnd, res.busy()));
-        final MenuRadioItemDescriptor offlineItem = createChatStatusAction(res.offline(), i18n.t("Sign out of chat"),
-                new ChangeOfflineStatusAction(res.offline()));
-        userOptions.addAction(onlineItem);
-        userOptions.addAction(availableItem);
-        userOptions.addAction(awayItem);
-        userOptions.addAction(busyItem);
-        userOptions.addAction(offlineItem);
-        xmppSession.addSessionStateChangedHandler(false, new StateChangedHandler() {
+  private static final String CHAT_STATUS = "k-chat-status-group";
+  private static final String GROUP_CHAT_STATUS = "k-group-chat-status";
+  private static final String NO_STATUS = null;
+  private final ChatClient chatClient;
+  private final I18nTranslationService i18n;
+  private Presence nextPresence = Presence.build(NO_STATUS, Show.notSpecified);
+  private final PresenceManager presenceManager;
+  private final ChatResources res;
+  private final SiteUserOptions userOptions;
+  private final XmppSession xmppSession;
 
-            @Override
-            public void onStateChanged(final StateChangedEvent event) {
-                if (xmppSession.isReady()) {
-                    presenceManager.changeOwnPresence(nextPresence);
-                    switch (nextPresence.getShow()) {
-                    case notSpecified:
-                        onlineItem.setChecked(true);
-                        break;
-                    case dnd:
-                        busyItem.setChecked(true);
-                        break;
-                    case chat:
-                        availableItem.setChecked(true);
-                        break;
-                    case away:
-                        awayItem.setChecked(true);
-                        break;
-                    }
-                } else {
-                    offlineItem.setChecked(true);
-                }
-            }
-        });
-    }
+  @Inject
+  public ChatSitebarActions(final Session session, final ChatClient chatClient,
+      final SiteUserOptions userOptions, final I18nTranslationService i18n, final ChatResources res,
+      final ChatInstances chatInstances) {
+    this.chatClient = chatClient;
+    this.userOptions = userOptions;
+    this.i18n = i18n;
+    this.res = res;
+    xmppSession = chatInstances.xmppSession;
+    presenceManager = chatInstances.presenceManager;
+    createActions();
+  }
 
-    private MenuRadioItemDescriptor createChatStatusAction(final ImageResource icon, final String text,
-            final AbstractAction action) {
-        final MenuRadioItemDescriptor item = new MenuRadioItemDescriptor(SiteUserOptionsPresenter.LOGGED_USER_MENU,
-                action, GROUP_CHAT_STATUS);
-        item.putValue(AbstractAction.NAME, text);
-        item.putValue(AbstractAction.SMALL_ICON, icon);
-        return item;
-    }
+  private void createActions() {
+    final MenuTitleItemDescriptor chatActionsTitle = new MenuTitleItemDescriptor(
+        SiteUserOptionsPresenter.LOGGED_USER_MENU, i18n.t("Set your chat status"));
+    userOptions.addAction(new MenuSeparatorDescriptor(SiteUserOptionsPresenter.LOGGED_USER_MENU));
+    userOptions.addAction(chatActionsTitle);
+    final MenuRadioItemDescriptor onlineItem = createChatStatusAction(res.online(), i18n.t("Available"),
+        onlineAction(NO_STATUS, Show.notSpecified, res.online()));
+    final MenuRadioItemDescriptor availableItem = createChatStatusAction(res.xa(),
+        i18n.t("Available for chat"), onlineAction(NO_STATUS, Show.chat, res.xa()));
+    final MenuRadioItemDescriptor awayItem = createChatStatusAction(res.away(), i18n.t("Away"),
+        onlineAction(NO_STATUS, Show.away, res.away()));
+    final MenuRadioItemDescriptor busyItem = createChatStatusAction(res.busy(), i18n.t("Busy"),
+        onlineAction(NO_STATUS, Show.dnd, res.busy()));
+    final MenuRadioItemDescriptor offlineItem = createChatStatusAction(res.offline(),
+        i18n.t("Sign out of chat"), new ChangeOfflineStatusAction(xmppSession, res.offline()));
+    userOptions.addAction(onlineItem);
+    userOptions.addAction(availableItem);
+    userOptions.addAction(awayItem);
+    userOptions.addAction(busyItem);
+    userOptions.addAction(offlineItem);
+    xmppSession.addSessionStateChangedHandler(false, new StateChangedHandler() {
 
-    private AbstractExtendedAction onlineAction(final String statusText, final Show show, final ImageResource icon) {
-        return new ChangeOnlineStatusAction(statusText, show, icon);
-    }
+      @Override
+      public void onStateChanged(final StateChangedEvent event) {
+        if (xmppSession.isReady()) {
+          presenceManager.changeOwnPresence(nextPresence);
+          switch (nextPresence.getShow()) {
+          case notSpecified:
+            onlineItem.setChecked(true);
+            break;
+          case dnd:
+            busyItem.setChecked(true);
+            break;
+          case chat:
+            availableItem.setChecked(true);
+            break;
+          case away:
+            awayItem.setChecked(true);
+            break;
+          }
+        } else {
+          offlineItem.setChecked(true);
+        }
+      }
+    });
+  }
+
+  private MenuRadioItemDescriptor createChatStatusAction(final ImageResource icon, final String text,
+      final AbstractAction action) {
+    final MenuRadioItemDescriptor item = new MenuRadioItemDescriptor(
+        SiteUserOptionsPresenter.LOGGED_USER_MENU, action, GROUP_CHAT_STATUS);
+    item.putValue(AbstractAction.NAME, text);
+    item.putValue(AbstractAction.SMALL_ICON, icon);
+    return item;
+  }
+
+  private AbstractExtendedAction onlineAction(final String statusText, final Show show,
+      final ImageResource icon) {
+    return new ChangeOnlineStatusAction(presenceManager, statusText, show, icon);
+  }
 }

Modified: trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -23,6 +23,7 @@
 import java.util.List;
 
 import cc.kune.chat.client.ChatClient;
+import cc.kune.chat.client.ChatInstances;
 import cc.kune.chat.client.resources.ChatResources;
 import cc.kune.common.client.actions.Action;
 import cc.kune.common.client.actions.ActionEvent;
@@ -43,7 +44,6 @@
 import com.calclab.emite.xep.muc.client.Occupant;
 import com.calclab.emite.xep.muc.client.Room;
 import com.calclab.emite.xep.muc.client.RoomManager;
-import com.calclab.suco.client.Suco;
 import com.google.inject.Inject;
 
 public class OpenGroupPublicChatRoomAction extends RolActionAutoUpdated {
@@ -51,19 +51,19 @@
   private final ChatClient chatClient;
   private final I18nTranslationService i18n;
   private boolean inviteMembers;
-  private final RoomManager roomManager;
   private final Session session;
 
   @SuppressWarnings("deprecation")
   @Inject
   public OpenGroupPublicChatRoomAction(final Session session,
       final AccessRightsClientManager accessRightsClientManager, final ChatClient chatClient,
-      final StateManager stateManager, final I18nTranslationService i18n, final ChatResources res) {
+      final StateManager stateManager, final I18nTranslationService i18n, final ChatResources res,
+      final ChatInstances chatInstances) {
     super(stateManager, session, accessRightsClientManager, AccessRolDTO.Editor, true, false, true);
     this.session = session;
     this.chatClient = chatClient;
     this.i18n = i18n;
-    roomManager = Suco.get(RoomManager.class);
+    final RoomManager roomManager = chatInstances.roomManager;
     stateManager.onStateChanged(true, new StateChangedHandler() {
       @Override
       public void onStateChanged(final StateChangedEvent event) {

Modified: trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithMemberAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithMemberAction.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithMemberAction.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -26,33 +26,40 @@
 import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.UserSimpleDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
-import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 
 public class StartChatWithMemberAction extends AbstractExtendedAction {
-    private final Provider<ChatClient> chatClient;
-    private final I18nTranslationService i18n;
+  private final Provider<ChatClient> chatClient;
+  private final I18nTranslationService i18n;
 
-    @Inject
-    public StartChatWithMemberAction(final I18nTranslationService i18n, final CoreResources res,
-            final Provider<ChatClient> chatClient) {
-        this.i18n = i18n;
-        this.chatClient = chatClient;
-        putValue(NAME, i18n.t("Chat with this member"));
-        putValue(Action.SMALL_ICON, res.newChat());
-    }
+  @Inject
+  public StartChatWithMemberAction(final I18nTranslationService i18n, final CoreResources res,
+      final Provider<ChatClient> chatClient) {
+    this.i18n = i18n;
+    this.chatClient = chatClient;
+    putValue(NAME, i18n.t("Chat with this member"));
+    putValue(Action.SMALL_ICON, res.newChat());
+  }
 
-    @Override
-    public void actionPerformed(final ActionEvent event) {
-        chatClient.get().show();
-        if (chatClient.get().isLoggedIn()) {
-            chatClient.get().chat(XmppURI.jid(((GroupDTO) event.getTarget()).getShortName()));
-        } else {
-            NotifyUser.important(i18n.t("To start a chat you need to be 'online'"));
-        }
+  @Override
+  public void actionPerformed(final ActionEvent event) {
+    chatClient.get().show();
+    if (chatClient.get().isLoggedIn()) {
+      String username = null;
+      if (event.getTarget() instanceof GroupDTO) {
+        username = ((GroupDTO) event.getTarget()).getShortName();
+      } else if (event.getTarget() instanceof UserSimpleDTO) {
+        username = ((UserSimpleDTO) event.getTarget()).getShortName();
+      }
+      if (username != null) {
+        chatClient.get().chat(username);
+      }
+    } else {
+      NotifyUser.important(i18n.t("To start a chat you need to be 'online'"));
     }
-
+  }
 }

Added: trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithThisPersonAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithThisPersonAction.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithThisPersonAction.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,36 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.chat.client.actions;
+
+import cc.kune.chat.client.ChatClient;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class StartChatWithThisPersonAction extends StartChatWithMemberAction {
+    @Inject
+    public StartChatWithThisPersonAction(final I18nTranslationService i18n, final CoreResources res,
+            final Provider<ChatClient> chatClient) {
+        super(i18n, res, chatClient);
+        putValue(NAME, i18n.t("Chat with this person"));
+    }
+}

Deleted: trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithUserAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithUserAction.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/chat/client/actions/StartChatWithUserAction.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.chat.client.actions;
-
-import cc.kune.chat.client.ChatClient;
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class StartChatWithUserAction extends StartChatWithMemberAction {
-    @Inject
-    public StartChatWithUserAction(final I18nTranslationService i18n, final CoreResources res,
-            final Provider<ChatClient> chatClient) {
-        super(i18n, res, chatClient);
-        putValue(NAME, i18n.t("Chat with this person"));
-    }
-}

Added: trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsBuddieCondition.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,72 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.chat.client.actions.conditions;
+
+import cc.kune.chat.client.ChatClient;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.GuiAddCondition;
+import cc.kune.common.client.errors.UIException;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.UserSimpleDTO;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class IsBuddieCondition implements GuiAddCondition {
+
+  private final ChatClient chatClient;
+  private final Session session;
+
+  @Inject
+  public IsBuddieCondition(final Session session, final ChatClient chatClient) {
+    this.chatClient = chatClient;
+    this.session = session;
+  }
+
+  private boolean isBuddie(final String targetName) {
+    return chatClient.isBuddie(targetName);
+  }
+
+  private boolean isThisGroupInRoster(final GuiActionDescrip descr) {
+    final String targetName = ((GroupDTO) descr.getTarget()).getShortName();
+    return isBuddie(targetName);
+  }
+
+  private boolean isThisPersonInRoster(final GuiActionDescrip descr) {
+    final String targetName = ((UserSimpleDTO) descr.getTarget()).getShortName();
+    return isBuddie(targetName);
+  }
+
+  @Override
+  public boolean mustBeAdded(final GuiActionDescrip descr) {
+    if (session.isNotLogged()) {
+      return false;
+    }
+    if (descr.getTarget() instanceof UserSimpleDTO) {
+      return isThisPersonInRoster(descr);
+    } else if (descr.getTarget() instanceof GroupDTO) {
+      return isThisGroupInRoster(descr);
+    } else {
+      throw new UIException("Unsupported target");
+    }
+  }
+}

Added: trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/conditions/IsNotBuddieCondition.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,23 @@
+package cc.kune.chat.client.actions.conditions;
+
+import cc.kune.chat.client.ChatClient;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.core.client.state.Session;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class IsNotBuddieCondition extends IsBuddieCondition {
+
+  @Inject
+  public IsNotBuddieCondition(final Session session, final ChatClient chatClient) {
+    super(session, chatClient);
+  }
+
+  @Override
+  public boolean mustBeAdded(final GuiActionDescrip descr) {
+    return !super.mustBeAdded(descr);
+  }
+
+}

Added: trunk/src/main/java/cc/kune/common/client/ui/AbstractDecorator.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/AbstractDecorator.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/ui/AbstractDecorator.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,79 @@
+package cc.kune.common.client.ui;
+
+import cc.kune.common.client.tooltip.Tooltip;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Style.Float;
+import com.google.gwt.dom.client.Style.Position;
+import com.google.gwt.dom.client.Style.Unit;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class AbstractDecorator extends Composite {
+
+  interface Binder extends UiBinder<Widget, AbstractDecorator> {
+  }
+  private static final Binder BINDER = GWT.create(Binder.class);
+  @UiField
+  Image decorationImage;
+  private int left = 0;
+
+  @UiField
+  FlowPanel mainPanel;
+  private int offset = 0;
+  private int top = 0;
+  @UiField
+  SimplePanel widgetContainer;
+
+  public AbstractDecorator() {
+    initWidget(BINDER.createAndBindUi(this));
+  }
+
+  public void clearImage() {
+    decorationImage.setVisible(false);
+  }
+
+  public void setDecoratorVisible(final boolean visible) {
+    decorationImage.setVisible(visible);
+  }
+
+  public void setImage(final ImageResource img) {
+    decorationImage.setResource(img);
+    decorationImage.setVisible(true);
+    setPosition();
+  }
+
+  public void setImagePosition(final int top, final int left, final int offset) {
+    this.top = top;
+    this.left = left;
+    this.offset = offset;
+    setPosition();
+  }
+
+  public void setImageTooltip(final String text) {
+    Tooltip.to(decorationImage, text);
+  }
+
+  private void setPosition() {
+    final Element elem = decorationImage.getElement();
+    elem.getStyle().setPropertyPx("left", left);
+    elem.getStyle().setPropertyPx("top", top);
+    elem.getStyle().setPosition(Position.RELATIVE);
+    elem.getStyle().setFloat(Float.LEFT);
+    elem.getStyle().setMarginRight(offset, Unit.PX);
+  }
+
+  public void setWidget(final IsWidget widget) {
+    widgetContainer.clear();
+    widgetContainer.add(widget);
+  }
+
+}

Added: trunk/src/main/java/cc/kune/common/client/ui/AbstractDecorator.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/AbstractDecorator.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/ui/AbstractDecorator.ui.xml	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
+  xmlns:g='urn:import:com.google.gwt.user.client.ui'>
+  <ui:style>
+    .image {
+      position: relative;
+      top: 0px;
+      left: 0px;
+      float: left;
+    }
+
+    .container {
+      float: left;
+    }
+  </ui:style>
+
+  <g:FlowPanel ui:field="mainPanel">
+    <g:SimplePanel ui:field="widgetContainer" styleName="{style.container}" />
+      <g:Image ui:field="decorationImage"
+    styleName="{style.image}" />
+  </g:FlowPanel>
+</ui:UiBinder>

Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -217,7 +217,7 @@
 
     s(ErrorsDialog.class);
     s(XMLActionsParser.class);
-    bind(Services.class).to(GWTServices.class);
+    s(Services.class, GWTServices.class);
   }
 
 }

Added: trunk/src/main/java/cc/kune/core/client/avatar/AvatarDecorator.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/avatar/AvatarDecorator.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/avatar/AvatarDecorator.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,13 @@
+package cc.kune.core.client.avatar;
+
+import com.google.gwt.user.client.ui.IsWidget;
+
+public interface AvatarDecorator {
+
+  void setDecoratorVisible(boolean visible);
+
+  void setItem(String name);
+
+  void setWidget(IsWidget widget);
+
+}

Added: trunk/src/main/java/cc/kune/core/client/avatar/MediumAvatarDecorator.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/avatar/MediumAvatarDecorator.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/avatar/MediumAvatarDecorator.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,5 @@
+package cc.kune.core.client.avatar;
+
+public interface MediumAvatarDecorator extends AvatarDecorator {
+
+}

Added: trunk/src/main/java/cc/kune/core/client/avatar/SmallAvatarDecorator.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/avatar/SmallAvatarDecorator.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/avatar/SmallAvatarDecorator.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -0,0 +1,5 @@
+package cc.kune.core.client.avatar;
+
+public interface SmallAvatarDecorator extends AvatarDecorator {
+
+}

Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -271,6 +271,42 @@
   @Source("charfontname.png")
   ImageResource charfontname();
 
+  @Source("chat-dot-available-medium.png")
+  ImageResource chatDotAvailableMedium();
+
+  @Source("chat-dot-available-small.png")
+  ImageResource chatDotAvailableSmall();
+
+  @Source("chat-dot-away-medium.png")
+  ImageResource chatDotAwayMedium();
+
+  @Source("chat-dot-away-small.png")
+  ImageResource chatDotAwaySmall();
+
+  @Source("chat-dot-busy-medium.png")
+  ImageResource chatDotBusyMedium();
+
+  @Source("chat-dot-busy-small.png")
+  ImageResource chatDotBusySmall();
+
+  @Source("chat-dot-extended-away-medium.png")
+  ImageResource chatDotExtendedAwayMedium();
+
+  @Source("chat-dot-extended-away-small.png")
+  ImageResource chatDotExtendedAwaySmall();
+
+  @Source("chat-dot-invisible-medium.png")
+  ImageResource chatDotInvisibleMedium();
+
+  @Source("chat-dot-invisible-small.png")
+  ImageResource chatDotInvisibleSmall();
+
+  @Source("chat-dot-offline-medium.png")
+  ImageResource chatDotOfflineMedium();
+
+  @Source("chat-dot-offline-small.png")
+  ImageResource chatDotOfflineSmall();
+
   @Source("checked.png")
   ImageResource checked();
 

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-available-medium.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-available-medium.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-available-small.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-available-small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-away-medium.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-away-medium.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-away-small.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-away-small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-busy-medium.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-busy-medium.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-busy-small.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-busy-small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-extended-away-medium.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-extended-away-medium.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-extended-away-small.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-extended-away-small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-invisible-medium.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-invisible-medium.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-invisible-small.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-invisible-small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-offline-medium.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-offline-medium.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-offline-small.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/cc/kune/core/client/resources/chat-dot-offline-small.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -142,7 +142,7 @@
       @Override
       public void onWindowFocus(final WindowFocusEvent event) {
         if (event.isHasFocus() && !mask.isShowing()) {
-          showTooltipWithDelay();
+          // showTooltipWithDelay();
         }
       }
     });

Modified: trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -29,6 +29,7 @@
 import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
 import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.ui.BasicThumb;
+import cc.kune.core.client.avatar.SmallAvatarDecorator;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.gspace.client.GSpaceArmor;
 
@@ -43,6 +44,7 @@
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.ScrollPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Provider;
 import com.gwtplatform.mvp.client.ViewImpl;
 
 public class AbstractSNPanel extends ViewImpl {
@@ -52,11 +54,11 @@
 
   private final static int AVATARLABELMAXSIZE = 4;
   private final static int AVATARSIZE = 22;
-  private final static String CATEG_HEIGHT = "80px";
+  private final static String CATEG_HEIGHT = "84px";
   private static AbstractSNPanelUiBinder uiBinder = GWT.create(AbstractSNPanelUiBinder.class);
-
   protected final ActionSimplePanel actions;
   protected final GSpaceArmor armor;
+  protected final Provider<SmallAvatarDecorator> avatarDecoratorProv;
   ActionFlowPanel bottomActionsToolbar;
   @UiField
   FlowPanel bottomPanel;
@@ -103,8 +105,9 @@
   protected final Widget widget;
 
   public AbstractSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider,
-      final GSpaceArmor armor) {
+      final GSpaceArmor armor, final Provider<SmallAvatarDecorator> avatarDecorator) {
     this.armor = armor;
+    this.avatarDecoratorProv = avatarDecorator;
     widget = uiBinder.createAndBindUi(this);
     actions = new ActionSimplePanel(guiProvider);
   }
@@ -144,6 +147,13 @@
     return thumb;
   }
 
+  public SmallAvatarDecorator decorateAvatarWithXmppStatus(final String shortname, final BasicThumb thumb) {
+    final SmallAvatarDecorator decorator = avatarDecoratorProv.get();
+    decorator.setWidget(thumb);
+    decorator.setItem(shortname);
+    return decorator;
+  }
+
   public IsActionExtensible getBottomToolbar() {
     return bottomActionsToolbar;
   }

Modified: trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.ui.xml	2011-07-10 18:29:52 UTC (rev 1446)
@@ -14,8 +14,9 @@
       <g:Label ui:field="firstDeckLabel" addStyleNames="k-sn-novisible-label" />
       <g:Label ui:field="sndDeckLabel" addStyleNames="k-sn-orphan-label" />
       <g:FlowPanel width="100%" ui:field="categoriesFlow">
+      <!--  Seed AbstractSNPanel.CATEG_HEIGHT-->
         <g:DockLayoutPanel unit="EM" width="100%" ui:field="firstCategoryPanel"
-          addStyleNames="k-sn-1st-panel" height="80px">
+          addStyleNames="k-sn-1st-panel" height="84px">
           <g:north size="1.2">
             <g:FlowPanel>
               <g:Label text="Admins" ui:field="firstCategoryLabel"
@@ -32,7 +33,7 @@
         </g:DockLayoutPanel>
         <g:DockLayoutPanel unit="EM" width="100%"
           ui:field="sndCategoryPanel" addStyleNames="k-sn-2nd-panel"
-          height="80px">
+          height="84px">
           <g:north size="1.2">
             <g:FlowPanel>
               <g:Label text="Collabs" ui:field="sndCategoryLabel"
@@ -50,7 +51,7 @@
         </g:DockLayoutPanel>
         <g:DockLayoutPanel unit="EM" width="100%"
           ui:field="trdCategoryPanel" addStyleNames="k-sn-3rd-panel"
-          height="80px">
+          height="84px">
           <g:north size="1.2">
             <g:FlowPanel>
               <g:Label text="Pendings" ui:field="trdCategoryLabel"

Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -24,19 +24,22 @@
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
 import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.ui.BasicThumb;
+import cc.kune.core.client.avatar.SmallAvatarDecorator;
 import cc.kune.core.client.sn.GroupSNPresenter.GroupSNView;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.gspace.client.GSpaceArmor;
 
+import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 
 public class GroupSNPanel extends AbstractSNPanel implements GroupSNView {
 
   @Inject
   public GroupSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider,
-      final GSpaceArmor armor) {
-    super(i18n, guiProvider, armor);
+      final GSpaceArmor armor, final Provider<SmallAvatarDecorator> avatarDecorator) {
+    super(i18n, guiProvider, armor, avatarDecorator);
     setVisibleImpl(false);
     mainTitle.setText(i18n.t("Group members"));
     Tooltip.to(mainTitle, i18n.t("People and groups collaborating in this group"));
@@ -59,14 +62,16 @@
   public void addAdmin(final GroupDTO group, final String avatarUrl, final String tooltip,
       final String tooltipTitle, final GuiActionDescCollection menu) {
     final BasicThumb thumb = createThumb(group.getShortName(), avatarUrl, tooltip, tooltipTitle, menu);
-    firstCategoryFlow.add(thumb);
+    firstCategoryFlow.add(group.isPersonal() ? (Widget) decorateAvatarWithXmppStatus(
+        group.getShortName(), thumb) : thumb);
   }
 
   @Override
   public void addCollab(final GroupDTO group, final String avatarUrl, final String tooltip,
       final String tooltipTitle, final GuiActionDescCollection menu) {
     final BasicThumb thumb = createThumb(group.getShortName(), avatarUrl, tooltip, tooltipTitle, menu);
-    sndCategoryFlow.add(thumb);
+    sndCategoryFlow.add(group.isPersonal() ? (Widget) decorateAvatarWithXmppStatus(group.getShortName(),
+        thumb) : thumb);
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -22,6 +22,8 @@
 import cc.kune.common.client.actions.ui.ActionFlowPanel;
 import cc.kune.common.client.actions.ui.bind.GuiProvider;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.ui.BasicThumb;
+import cc.kune.core.client.avatar.SmallAvatarDecorator;
 import cc.kune.core.client.resources.CoreMessages;
 import cc.kune.core.client.sn.UserSNPresenter.UserSNView;
 import cc.kune.core.shared.dto.GroupDTO;
@@ -30,7 +32,9 @@
 import cc.kune.gspace.client.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 
 public class UserSNPanel extends AbstractSNPanel implements UserSNView {
 
@@ -38,9 +42,10 @@
 
   @Inject
   public UserSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider,
-      final GSpaceArmor armor) {
-    super(i18n, guiProvider, armor);
+      final GSpaceArmor armor, final Provider<SmallAvatarDecorator> avatarDecorator) {
+    super(i18n, guiProvider, armor, avatarDecorator);
     this.i18n = i18n;
+
     setVisibleImpl(false);
     mainTitle.setText(i18n.t("His/her network:"));
     mainTitle.setTitle(i18n.t("This user buddies and groups where participes"));
@@ -62,7 +67,8 @@
   @Override
   public void addBuddie(final UserSimpleDTO user, final String avatarUrl, final String tooltip,
       final String tooltipTitle, final GuiActionDescCollection menu) {
-    firstCategoryFlow.add(createThumb(user.getShortName(), avatarUrl, tooltip, tooltipTitle, menu));
+    final BasicThumb thumb = createThumb(user.getShortName(), avatarUrl, tooltip, tooltipTitle, menu);
+    firstCategoryFlow.add((Widget) decorateAvatarWithXmppStatus(user.getShortName(), thumb));
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsMeCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsMeCondition.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsMeCondition.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -28,13 +28,16 @@
 @Singleton
 public class IsMeCondition extends IsNotMeCondition {
 
-    @Inject
-    public IsMeCondition(final Session session) {
-        super(session);
-    }
+  @Inject
+  public IsMeCondition(final Session session) {
+    super(session);
+  }
 
-    @Override
-    public boolean mustBeAdded(final GuiActionDescrip descr) {
-        return !super.mustBeAdded(descr);
+  @Override
+  public boolean mustBeAdded(final GuiActionDescrip descr) {
+    if (session.isNotLogged()) {
+      return false;
     }
+    return !super.mustBeAdded(descr);
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotMeCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotMeCondition.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotMeCondition.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -32,40 +32,40 @@
 @Singleton
 public class IsNotMeCondition implements GuiAddCondition {
 
-    private final Session session;
+  protected final Session session;
 
-    @Inject
-    public IsNotMeCondition(final Session session) {
-        this.session = session;
-    }
+  @Inject
+  public IsNotMeCondition(final Session session) {
+    this.session = session;
+  }
 
-    private String currentName() {
-        return session.getCurrentUser().getShortName();
-    }
+  private String currentName() {
+    return session.getCurrentUser().getShortName();
+  }
 
-    private boolean isNotThisGroup(final GuiActionDescrip descr) {
-        final String targetName = ((GroupDTO) descr.getTarget()).getShortName();
-        final String currentName = currentName();
-        return !currentName.equals(targetName);
-    }
+  private boolean isNotThisGroup(final GuiActionDescrip descr) {
+    final String targetName = ((GroupDTO) descr.getTarget()).getShortName();
+    final String currentName = currentName();
+    return !currentName.equals(targetName);
+  }
 
-    private boolean isNotThisPerson(final GuiActionDescrip descr) {
-        final String targetName = ((UserSimpleDTO) descr.getTarget()).getShortName();
-        final String currentName = currentName();
-        return !currentName.equals(targetName);
-    }
+  private boolean isNotThisPerson(final GuiActionDescrip descr) {
+    final String targetName = ((UserSimpleDTO) descr.getTarget()).getShortName();
+    final String currentName = currentName();
+    return !currentName.equals(targetName);
+  }
 
-    @Override
-    public boolean mustBeAdded(final GuiActionDescrip descr) {
-        if (session.isNotLogged()) {
-            return true;
-        }
-        if (descr.getTarget() instanceof UserSimpleDTO) {
-            return isNotThisPerson(descr);
-        } else if (descr.getTarget() instanceof GroupDTO) {
-            return isNotThisGroup(descr);
-        } else {
-            throw new UIException("Unsupported target");
-        }
+  @Override
+  public boolean mustBeAdded(final GuiActionDescrip descr) {
+    if (session.isNotLogged()) {
+      return true;
     }
+    if (descr.getTarget() instanceof UserSimpleDTO) {
+      return isNotThisPerson(descr);
+    } else if (descr.getTarget() instanceof GroupDTO) {
+      return isNotThisGroup(descr);
+    } else {
+      throw new UIException("Unsupported target");
+    }
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -43,43 +43,52 @@
 @SuppressWarnings("serial")
 public class UserSNMenuItemsRegistry extends AbstractSNMembersActionsRegistry {
 
-    @Inject
-    public UserSNMenuItemsRegistry(final Session session,
-            final IsCurrentStateAdministrableCondition isAdministrableCondition,
-            final IsPersonCondition isPersonCondition, final IsGroupCondition isGroupCondition,
-            final IsLoggedCondition isLoggedCondition, final IsMeCondition isMe, final IsNotMeCondition isNotMe,
-            final ChangeToCollabAction changeToCollabAction, final ChangeToAdminAction changeToAdminAction,
-            final RemoveMemberAction removeMemberAction, final AcceptJoinGroupAction acceptJoinGroupAction,
-            final DenyJoinGroupAction denyJoinGroupAction, final GotoGroupAction gotoGroupAction,
-            final GotoPersonAction gotoPersonAction, final UnJoinGroupAction unjoinAction,
-            final GotoYourHomePageAction gotoYourHomePageAction) {
-        add(new Provider<MenuItemDescriptor>() {
-            @Override
-            public MenuItemDescriptor get() {
-                final MenuItemDescriptor item = new MenuItemDescriptor(gotoPersonAction);
-                item.add(isPersonCondition);
-                item.add(isNotMe);
-                return item;
-            }
-        });
-        add(new Provider<MenuItemDescriptor>() {
-            @Override
-            public MenuItemDescriptor get() {
-                final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
-                item.add(isGroupCondition);
-                return item;
-            }
-        });
-        // This doesn't works, because its unregister from current state not
-        // from target group
-        // add(new Provider<MenuItemDescriptor>() {
-        // @Override
-        // public MenuItemDescriptor get() {
-        // final MenuItemDescriptor item = new MenuItemDescriptor(unjoinAction);
-        // item.add(isLoggedCondition);
-        // item.add(isGroupCondition);
-        // return item;
-        // }
-        // });
-    }
+  @Inject
+  public UserSNMenuItemsRegistry(final Session session,
+      final IsCurrentStateAdministrableCondition isAdministrableCondition,
+      final IsPersonCondition isPersonCondition, final IsGroupCondition isGroupCondition,
+      final IsLoggedCondition isLoggedCondition, final IsMeCondition isMe,
+      final IsNotMeCondition isNotMe, final ChangeToCollabAction changeToCollabAction,
+      final ChangeToAdminAction changeToAdminAction, final RemoveMemberAction removeMemberAction,
+      final AcceptJoinGroupAction acceptJoinGroupAction, final DenyJoinGroupAction denyJoinGroupAction,
+      final GotoGroupAction gotoGroupAction, final GotoPersonAction gotoPersonAction,
+      final UnJoinGroupAction unjoinAction, final GotoYourHomePageAction gotoYourHomePageAction) {
+    add(new Provider<MenuItemDescriptor>() {
+      @Override
+      public MenuItemDescriptor get() {
+        final MenuItemDescriptor item = new MenuItemDescriptor(gotoPersonAction);
+        item.add(isPersonCondition);
+        item.add(isNotMe);
+        return item;
+      }
+    });
+    add(new Provider<MenuItemDescriptor>() {
+      @Override
+      public MenuItemDescriptor get() {
+        final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
+        item.add(isGroupCondition);
+        return item;
+      }
+    });
+    add(new Provider<MenuItemDescriptor>() {
+      @Override
+      public MenuItemDescriptor get() {
+        final MenuItemDescriptor item = new MenuItemDescriptor(gotoYourHomePageAction);
+        item.add(isPersonCondition);
+        item.add(isMe);
+        return item;
+      }
+    });
+    // This doesn't works, because its unregister from current state not
+    // from target group
+    // add(new Provider<MenuItemDescriptor>() {
+    // @Override
+    // public MenuItemDescriptor get() {
+    // final MenuItemDescriptor item = new MenuItemDescriptor(unjoinAction);
+    // item.add(isLoggedCondition);
+    // item.add(isGroupCondition);
+    // return item;
+    // }
+    // });
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -44,109 +44,116 @@
 
 public class EntityHeaderPanel extends ViewImpl implements EntityHeaderView {
 
-    private final Provider<FileDownloadUtils> downloadProvider;
-    private final EntityTextLogo entityTextLogo;
-    private final CoreResources images;
-    private final HorizontalPanel mainPanel;
-    private final ActionFlowPanel toolbar;
-    private final VerticalPanel vpanel;
+  private final Provider<FileDownloadUtils> downloadProvider;
+  private final EntityTextLogo entityTextLogo;
+  private final CoreResources images;
+  private final HorizontalPanel mainPanel;
+  private final ActionFlowPanel toolbar;
+  private final VerticalPanel vpanel;
 
-    @Inject
-    public EntityHeaderPanel(final Provider<FileDownloadUtils> downloadProvider, final CoreResources images,
-            final GuiProvider bindings, final GSpaceArmor armor) {
-        mainPanel = new HorizontalPanel();
-        mainPanel.setWidth("100%");
-        this.downloadProvider = downloadProvider;
-        this.images = images;
-        vpanel = new VerticalPanel();
-        vpanel.setWidth("100%");
-        vpanel.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
-        entityTextLogo = new EntityTextLogo();
-        mainPanel.add(entityTextLogo);
-        toolbar = new ActionFlowPanel(bindings);
-        vpanel.add(toolbar);
-        mainPanel.add(vpanel);
-        armor.getEntityHeader().add(mainPanel);
-    }
+  @Inject
+  public EntityHeaderPanel(final Provider<FileDownloadUtils> downloadProvider,
+      final CoreResources images, final GuiProvider bindings, final GSpaceArmor armor,
+      final EntityTextLogo entityTextLogo) {
+    this.entityTextLogo = entityTextLogo;
+    mainPanel = new HorizontalPanel();
+    mainPanel.setWidth("100%");
+    this.downloadProvider = downloadProvider;
+    this.images = images;
+    vpanel = new VerticalPanel();
+    vpanel.setWidth("100%");
+    vpanel.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
+    mainPanel.add(entityTextLogo);
+    toolbar = new ActionFlowPanel(bindings);
+    vpanel.add(toolbar);
+    mainPanel.add(vpanel);
+    armor.getEntityHeader().add(mainPanel);
+  }
 
-    @Override
-    public void addAction(final GuiActionDescrip descriptor) {
-        toolbar.add(descriptor);
-    }
+  @Override
+  public void addAction(final GuiActionDescrip descriptor) {
+    toolbar.add(descriptor);
+  }
 
-    @Override
-    public void addWidget(final IsWidget view) {
-        final Widget widget = (Widget) view;
-        vpanel.add(widget);
-    }
+  @Override
+  public void addWidget(final IsWidget view) {
+    final Widget widget = (Widget) view;
+    vpanel.add(widget);
+  }
 
-    @Override
-    public Widget asWidget() {
-        return mainPanel;
-    }
+  @Override
+  public Widget asWidget() {
+    return mainPanel;
+  }
 
-    @Override
-    public void reloadImage(final GroupDTO group) {
-        entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken()) + "&nocache="
-                + new Date().getTime());
-    }
+  private String getAvatarDecoratorParam(final GroupDTO group) {
+    return group.isPersonal() ? group.getShortName() : null;
+  }
 
-    @Deprecated
-    public void setFullLogo(final StateToken stateToken, final boolean clipped) {
-        mainPanel.clear();
-        final String imageUrl = downloadProvider.get().getImageUrl(stateToken);
-        Image logo;
-        if (clipped) {
-            logo = new Image(imageUrl, 0, 0, FileConstants.LOGO_DEF_WIDTH, FileConstants.LOGO_DEF_HEIGHT);
-        } else {
-            logo = new Image(imageUrl);
-            logo.setWidth(String.valueOf(FileConstants.LOGO_DEF_WIDTH));
-            logo.setHeight(String.valueOf(FileConstants.LOGO_DEF_HEIGHT));
-        }
-        mainPanel.add(logo);
-    }
+  @Override
+  public void reloadImage(final GroupDTO group) {
+    entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken())
+        + "&nocache=" + new Date().getTime(), getAvatarDecoratorParam(group));
+  }
 
-    @Override
-    public void setLargeFont() {
-        entityTextLogo.setLargeFont();
+  @Deprecated
+  public void setFullLogo(final StateToken stateToken, final boolean clipped) {
+    mainPanel.clear();
+    final String imageUrl = downloadProvider.get().getImageUrl(stateToken);
+    Image logo;
+    if (clipped) {
+      logo = new Image(imageUrl, 0, 0, FileConstants.LOGO_DEF_WIDTH, FileConstants.LOGO_DEF_HEIGHT);
+    } else {
+      logo = new Image(imageUrl);
+      logo.setWidth(String.valueOf(FileConstants.LOGO_DEF_WIDTH));
+      logo.setHeight(String.valueOf(FileConstants.LOGO_DEF_HEIGHT));
     }
+    mainPanel.add(logo);
+  }
 
-    @Override
-    public void setLogoImage(final StateToken stateToken) {
-        entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(stateToken));
-    }
+  @Override
+  public void setLargeFont() {
+    entityTextLogo.setLargeFont();
+  }
 
-    @Override
-    public void setLogoImageVisible(final boolean visible) {
-        entityTextLogo.setLogoVisible(visible);
-    }
+  @Override
+  public void setLogoImage(final GroupDTO group) {
+    entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken()),
+        getAvatarDecoratorParam(group));
+  }
 
-    @Override
-    public void setLogoText(final String groupName) {
-        entityTextLogo.setLogoText(groupName);
-    }
+  @Override
+  public void setLogoImageVisible(final boolean visible) {
+    entityTextLogo.setLogoVisible(visible);
+  }
 
-    @Override
-    public void setMediumFont() {
-        entityTextLogo.setMediumFont();
-    }
+  @Override
+  public void setLogoText(final String groupName) {
+    entityTextLogo.setLogoText(groupName);
+  }
 
-    //
-    // @Override
-    // public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
-    // if (oldTheme != null) {
-    // entityTextLogo.removeStyleDependentName(oldTheme.toString());
-    // }
-    // entityTextLogo.addStyleDependentName(newTheme.toString());
-    // }
+  @Override
+  public void setMediumFont() {
+    entityTextLogo.setMediumFont();
+  }
 
-    @Override
-    public void setSmallFont() {
-        entityTextLogo.setSmallFont();
-    }
+  //
+  // @Override
+  // public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+  // if (oldTheme != null) {
+  // entityTextLogo.removeStyleDependentName(oldTheme.toString());
+  // }
+  // entityTextLogo.addStyleDependentName(newTheme.toString());
+  // }
 
-    @Override
-    public void showDefUserLogo() {
-        entityTextLogo.setLogoImage(AbstractImagePrototype.create(images.unknown60()));
-    }
+  @Override
+  public void setSmallFont() {
+    entityTextLogo.setSmallFont();
+  }
+
+  @Override
+  public void showDefUserLogo(final GroupDTO group) {
+    entityTextLogo.setLogoImage(AbstractImagePrototype.create(images.unknown60()),
+        getAvatarDecoratorParam(group));
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -24,7 +24,6 @@
 import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.gspace.client.options.logo.CurrentLogoChangedEvent;
 import cc.kune.gspace.client.options.logo.CurrentLogoChangedEvent.CurrentLogoChangedHandler;
@@ -54,7 +53,7 @@
 
     void setLargeFont();
 
-    void setLogoImage(StateToken stateToken);
+    void setLogoImage(GroupDTO group);
 
     void setLogoImageVisible(boolean visible);
 
@@ -66,7 +65,7 @@
 
     // void setTheme(final WsTheme oldTheme, WsTheme newTheme);
 
-    void showDefUserLogo();
+    void showDefUserLogo(GroupDTO group);
   }
 
   private static final int LARGE_NAME_LIMIT = 17;
@@ -126,12 +125,12 @@
   void setGroupLogo(final GroupDTO group) {
     if (group.hasLogo()) {
       setLogoText(group.getLongName());
-      getView().setLogoImage(group.getStateToken());
+      getView().setLogoImage(group);
       getView().setLogoImageVisible(true);
     } else {
       setLogoText(group.getLongName());
       if (group.isPersonal()) {
-        getView().showDefUserLogo();
+        getView().showDefUserLogo(group);
         getView().setLogoImageVisible(true);
       } else {
         getView().setLogoImageVisible(false);

Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityTextLogo.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityTextLogo.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityTextLogo.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -19,11 +19,15 @@
  */
 package cc.kune.core.client.ws.entheader;
 
+import cc.kune.core.client.avatar.MediumAvatarDecorator;
+
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
 
 public class EntityTextLogo extends VerticalPanel {
 
@@ -34,16 +38,20 @@
   private static final String LOGO_MEDIUM_FONT_STYLE = "k-elogo-l-m";
   public static final String LOGO_NAME = "k-elogop-ln";
   private static final String LOGO_SMALL_FONT_STYLE = "k-elogo-l-s";
+  private final MediumAvatarDecorator avatarDecorator;
   private final Image logoImage;
   private final Label logoLabel;
 
-  public EntityTextLogo() {
+  @Inject
+  public EntityTextLogo(final MediumAvatarDecorator avatarDecorator) {
     // Initialize
     super();
+    this.avatarDecorator = avatarDecorator;
     final HorizontalPanel generalHP = new HorizontalPanel();
     final VerticalPanel logoTextVP = new VerticalPanel();
     logoImage = new Image();
     logoLabel = new Label();
+    avatarDecorator.setWidget(logoImage);
     final Label expandCell = new Label("");
 
     logoImage.ensureDebugId(LOGO_IMAGE);
@@ -51,7 +59,7 @@
 
     // Layout
     add(generalHP);
-    generalHP.add(logoImage);
+    generalHP.add((Widget) avatarDecorator);
     generalHP.add(logoTextVP);
     logoTextVP.add(logoLabel);
 
@@ -84,14 +92,16 @@
     logoLabel.addStyleName(LOGO_LARGE_FONT_STYLE);
   }
 
-  public void setLogoImage(final AbstractImagePrototype imageProto) {
+  public void setLogoImage(final AbstractImagePrototype imageProto, final String groupName) {
     imageProto.applyTo(logoImage);
+    avatarDecorator.setItem(groupName);
   }
 
-  public void setLogoImage(final String url) {
+  public void setLogoImage(final String url, final String groupName) {
     logoImage.setUrl("images/clear.gif");
     Image.prefetch(url);
     logoImage.setUrl(url);
+    avatarDecorator.setItem(groupName);
   }
 
   public void setLogoText(final String text) {
@@ -104,6 +114,7 @@
 
   public void setLogoVisible(final boolean visible) {
     logoImage.setVisible(visible);
+    avatarDecorator.setDecoratorVisible(visible);
   }
 
   public void setMediumFont() {

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -81,8 +81,6 @@
 
     void attach();
 
-    void highlightTitle();
-
     void clear();
 
     void detach();
@@ -91,6 +89,8 @@
 
     HasEditHandler getEditTitle();
 
+    void highlightTitle();
+
     void setActions(GuiActionDescCollection actions);
 
     void setContainer(StateContainerDTO state);
@@ -176,10 +176,6 @@
     }
   }
 
-  public void highlightTitle() {
-    getView().highlightTitle();
-  }
-
   String calculateStyle(final int pos, final int length) {
     if (length == 1) {
       return CSSBTN;
@@ -205,6 +201,7 @@
       }
       // Other contents (docs, etc)
       for (final ContentSimpleDTO content : container.getContents()) {
+        assert content != null;
         addItem(content, content.getMimeType(), content.getStatus(),
             content.getStateToken().copy().clearDocument(), content.getRights(), content.getModifiedOn());
       }
@@ -284,6 +281,10 @@
     }
   }
 
+  public void highlightTitle() {
+    getView().highlightTitle();
+  }
+
   public void refreshState() {
     setContent((HasContent) session.getCurrentState());
   }

Modified: trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2011-07-09 22:25:58 UTC (rev 1445)
+++ trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2011-07-10 18:29:52 UTC (rev 1446)
@@ -45,7 +45,7 @@
       super(session, true);
       ClientEvents.get().addNetworkStatusEventHandler(new NetworkStatusEventHandler() {
         private void goOnline() {
-          putValue(Action.NAME, i18n.t("Online"));
+          putValue(Action.NAME, ""); // i18n.t("Online"));
           putValue(AbstractAction.STYLES, "k-sitebar-wave-status, k-sitebar-wave-status-online");
           NotifyUser.hideProgress();
         }




More information about the kune-commits mailing list