gboolean hev_impathy_tls_verifier_verify_finish(HevImpathyTLSVerifier *self,
			GAsyncResult *res, TpTLSCertificateRejectReason *reason,
			GHashTable **details, GError **error)
{
	HevImpathyTLSVerifierPrivate *priv = NULL;

	g_debug("%s:%d[%s]", __FILE__, __LINE__, __FUNCTION__);

	g_return_val_if_fail(HEV_IS_IMPATHY_TLS_VERIFIER(self), FALSE);

	priv = HEV_IMPATHY_TLS_VERIFIER_GET_PRIVATE(self);

	if(g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(res),
					error))
	{
		if(NULL != reason)
		  *reason = (*error)->code;

		if(NULL != details)
		{
			*details = tp_asv_new(NULL, NULL);
			tp_g_hash_table_update(*details, priv->details,
						(GBoxedCopyFunc)g_strdup,
						(GBoxedCopyFunc)tp_g_value_slice_dup);
		}

		return FALSE;
	}

	if(NULL != reason)
	  *reason = TP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN;

	return TRUE;
}
gboolean
empathy_tls_verifier_verify_finish (EmpathyTLSVerifier *self,
    GAsyncResult *res,
    EmpTLSCertificateRejectReason *reason,
    GHashTable **details,
    GError **error)
{
  EmpathyTLSVerifierPriv *priv = GET_PRIV (self);

  if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res),
          error))
    {
      if (reason != NULL)
        *reason = (*error)->code;

      if (details != NULL)
        {
          *details = tp_asv_new (NULL, NULL);
          tp_g_hash_table_update (*details, priv->details,
              (GBoxedCopyFunc) g_strdup,
              (GBoxedCopyFunc) tp_g_value_slice_dup);
        }

      return FALSE;
    }

  if (reason != NULL)
    *reason = EMP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN;

  return TRUE;
}
void remmina_tp_channel_handler_new(const gchar *account_path, const gchar *connection_path, const gchar *channel_path,
		GHashTable *channel_properties, DBusGMethodInvocation *context)
{
	TpDBusDaemon *bus;
	TpAccount *account;
	GError *error = NULL;
	RemminaTpChannelHandler *chandler;

	bus = tp_dbus_daemon_dup(&error);
	if (bus == NULL)
	{
		g_print("tp_dbus_daemon_dup: %s", error->message);
		return;
	}
	account = tp_account_new(bus, account_path, &error);
	if (account == NULL)
	{
		g_object_unref(bus);
		g_print("tp_account_new: %s", error->message);
		return;
	}

	chandler = g_new0(RemminaTpChannelHandler, 1);
	chandler->bus = bus;
	chandler->account = account;
	chandler->connection_path = g_strdup(connection_path);
	chandler->channel_path = g_strdup(channel_path);
	chandler->channel_properties = tp_asv_new(NULL, NULL);
	tp_g_hash_table_update(chandler->channel_properties, channel_properties, (GBoxedCopyFunc) g_strdup,
			(GBoxedCopyFunc) tp_g_value_slice_dup);
	chandler->context = context;

	tp_account_prepare_async(account, NULL, remmina_tp_channel_handler_account_ready, chandler);
}
/*
 * Create a new TpSignalledMessage.
 *
 * Any message-sender and message-sender-id in parts[0] will be ignored
 * completely: the caller is responsible for interpreting those fields
 * and providing a suitable @sender.
 *
 * The message-sender will be removed from the header, and the
 * message-sender-id will be set to match the #TpContact:identifier of @sender.
 *
 * @sender may be %NULL, which means the message wasn't sent by a contact
 * (this could be used for administrative messages from a chatroom or the
 * server) or we have no idea who sent it.
 */
TpMessage *
_tp_signalled_message_new (const GPtrArray *parts,
    TpContact *sender)
{
  TpMessage *self;
  guint i;

  g_return_val_if_fail (parts != NULL, NULL);
  g_return_val_if_fail (parts->len > 0, NULL);
  g_return_val_if_fail (sender == NULL || TP_IS_CONTACT (sender), NULL);

  self = g_object_new (TP_TYPE_SIGNALLED_MESSAGE,
      "sender", sender,
      NULL);

  for (i = 0; i < parts->len; i++)
    {
      /* First part is automatically created */
      if (i != 0)
        tp_message_append_part (self);

      tp_g_hash_table_update (g_ptr_array_index (self->parts, i),
          g_ptr_array_index (parts, i),
          (GBoxedCopyFunc) g_strdup,
          (GBoxedCopyFunc) tp_g_value_slice_dup);
    }

  /* This handle may not be persistent, user should use the TpContact
   * directly */
  tp_message_delete_key (self, 0, "message-sender");

  /* override any message-sender-id that the message might have had */
  if (sender == NULL)
    {
      tp_message_delete_key (self, 0, "message-sender-id");
    }
  else
    {
      tp_message_set_string (self, 0, "message-sender-id",
          tp_contact_get_identifier (sender));
    }

  _tp_message_set_immutable (self);

  return self;
}
static void
tp_contact_factory_update_location (EmpathyTpContactFactory *tp_factory,
				    guint handle,
				    GHashTable *location)
{
	EmpathyContact *contact;
	GHashTable     *new_location;

	contact = tp_contact_factory_find_by_handle (tp_factory, handle);

	if (contact == NULL)
		return;

	new_location = g_hash_table_new_full (g_str_hash, g_str_equal,
		(GDestroyNotify) g_free, (GDestroyNotify) tp_g_value_slice_free);
	tp_g_hash_table_update (new_location, location, (GBoxedCopyFunc) g_strdup,
		(GBoxedCopyFunc) tp_g_value_slice_dup);
	empathy_contact_set_location (contact, new_location);
	g_hash_table_unref (new_location);

	tp_contact_factory_geocode (contact);
}
static void
update_remote_members (TpCallStream *self,
    GHashTable *updates,
    GPtrArray *removed)
{
  if (updates != NULL)
    {
      tp_g_hash_table_update (self->priv->remote_members, updates,
          g_object_ref, NULL);
    }

  if (removed != NULL)
    {
      guint i;

      for (i = 0; i < removed->len; i++)
        {
          g_hash_table_remove (self->priv->remote_members,
              g_ptr_array_index (removed, i));
        }
    }
}