Use el flag to properly detect MUCs and chatrooms
authorArtem Garmash <artemgarmash@gmail.com>
Sat, 24 Apr 2010 17:18:03 +0000 (20:18 +0300)
committerArtem Garmash <artem.garmash@nokia.com>
Sun, 27 Jun 2010 19:13:48 +0000 (22:13 +0300)
configure.ac
debian/control
src/el-home-applet.c

index e714ee1..8423154 100644 (file)
@@ -12,7 +12,8 @@ AM_PATH_GLIB_2_0([2.16.0])
 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls"
 
 PKG_CHECK_MODULES([LIBEVENT_LOGGER],
-                  [rtcom-eventlogger >= 1.2])
+                  [rtcom-eventlogger >= 1.2
+                  rtcom-eventlogger-plugins])
 
 hildonhomedesktopentrydir=`pkg-config libhildondesktop-1 --variable=hildonhomedesktopentrydir`
 AC_SUBST(hildonhomedesktopentrydir)
index b4cc610..01c1695 100644 (file)
@@ -4,7 +4,7 @@ Section: user/desktop
 Maintainer: Artem Garmash <artemgarmash@gmail.com>
 Build-Depends: debhelper (>= 4.0.0), cdbs, autotools-dev, librtcom-eventlogger-dev (>= 1.2),
  libhildondesktop1-dev (>= 2.1.7), libtelepathy-glib-dev, librtcom-telepathy-glib-dev,
- libosso-abook-dev
+ libosso-abook-dev, librtcom-eventlogger-plugins-dev
 Standards-Version: 3.6.2
 
 Package: conversations-inbox-widget
index ec3762d..26c4f14 100644 (file)
@@ -25,6 +25,7 @@
 #include <libintl.h>
 #include <hildon/hildon.h>
 #include <rtcom-eventlogger/eventlogger.h>
+#include <rtcom-eventlogger-plugins/chat.h>
 #include <sqlite3.h>
 #include <string.h>
 #include <gconf/gconf-client.h>
@@ -143,6 +144,7 @@ struct _ELHomeAppletPrivate
         gchar *remote_id;
         gchar *local_id;
         gchar *channel;
+        int flags;
         OssoABookContact *contact;
 
         gboolean time_fmt_24h;
@@ -991,6 +993,7 @@ show_event (ELHomeApplet *self, RTComElIter *it)
                                               "remote-ebook-uid", &priv->contact_id,
                                               "free-text", &priv->message,
                                               "channel", &priv->channel,
+                                              "flags", &priv->flags,
                                               NULL)) {
                         received = format_time (received_t, priv->time_fmt_24h);
 
@@ -1403,7 +1406,8 @@ open_conversation (ELHomeApplet *self)
         if (!account)
                 return;
 
-        if (!g_strcmp0 (account->protocol_name, "skype")) {
+        if ((priv->flags & RTCOM_EL_FLAG_CHAT_GROUP) &&
+            (priv->flags & RTCOM_EL_FLAG_CHAT_OPAQUE)) {
                 if (!priv->channel)
                         return;
 
@@ -1431,14 +1435,17 @@ open_conversation (ELHomeApplet *self)
                 MC_ACCOUNT_CRD_INIT (&request);
                 MC_ACCOUNT_CRD_SET (&request, channel_type, TP_IFACE_QUARK_CHANNEL_TYPE_TEXT);
 
-                if (priv->channel) {
+                if ((priv->flags & RTCOM_EL_FLAG_CHAT_ROOM) &&
+                    priv->channel) {
                         MC_ACCOUNT_CRD_SET (&request, target_handle_type, TP_HANDLE_TYPE_ROOM);
                         MC_ACCOUNT_CRD_SET (&request, target_id, priv->channel);
                 }
-                else {
+                else if (priv->remote_id) {
                         MC_ACCOUNT_CRD_SET (&request, target_handle_type, TP_HANDLE_TYPE_CONTACT);
                         MC_ACCOUNT_CRD_SET (&request, target_id, priv->remote_id);
                 }
+                else
+                        return;
 
                 mc_account_channelrequest (account,
                                            &request,