#include <libosso-abook/osso-abook-temporary-contact-dialog.h>
#include <libosso-abook/osso-abook-account-manager.h>
+#include <telepathy-glib/interfaces.h>
+
#define EL_HOME_APPLET_GET_PRIVATE(obj) ( \
G_TYPE_INSTANCE_GET_PRIVATE (obj, \
EL_TYPE_HOME_APPLET, ELHomeAppletPrivate))
}
}
+static void
+open_conversation (ELHomeApplet *self)
+{
+ ELHomeAppletPrivate *priv = self->priv;
+ McAccount *account;
+ McAccountChannelrequestData request;
+
+ if (!(priv->remote_id && priv->local_id))
+ return;
+
+ account = osso_abook_account_manager_lookup_by_name (NULL,
+ priv->local_id);
+ if (!account)
+ return;
+
+ MC_ACCOUNT_CRD_INIT (&request);
+ MC_ACCOUNT_CRD_SET (&request, channel_type, TP_IFACE_QUARK_CHANNEL_TYPE_TEXT);
+ MC_ACCOUNT_CRD_SET (&request, target_handle_type, TP_HANDLE_TYPE_CONTACT);
+ MC_ACCOUNT_CRD_SET (&request, target_id, priv->remote_id);
+
+ mc_account_channelrequest (
+ account,
+ &request,
+ time (NULL),
+ NULL, /* handler */
+ MC_ACCOUNT_CR_FLAG_USE_EXISTING,
+ NULL, NULL, NULL, NULL);
+}
+
static gboolean
read_new_event (ELHomeApplet *self)
{
}
else {
#ifndef DEBUG_LAYOUT
- mark_as_read (self);
+ /* mark_as_read (self); */
+ open_conversation (self);
#endif
}