Пример #1
0
static void
tp_tests_room_list_chan_class_init (
    TpTestsRoomListChanClass *klass)
{
  GObjectClass *oclass = G_OBJECT_CLASS (klass);
  TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass);
  GParamSpec *spec;
  static TpDBusPropertiesMixinPropImpl room_list_props[] = {
      { "Server", "server", NULL, },
      { NULL }
  };

  oclass->get_property = tp_tests_room_list_chan_get_property;
  oclass->set_property = tp_tests_room_list_chan_set_property;
  oclass->constructed = tp_tests_room_list_chan_constructed;
  oclass->finalize = tp_tests_room_list_chan_finalize;

  base_class->channel_type = TP_IFACE_CHANNEL_TYPE_ROOM_LIST;
  base_class->target_handle_type = TP_HANDLE_TYPE_NONE;
  base_class->fill_immutable_properties = fill_immutable_properties;
  base_class->close = room_list_chan_close;

  spec = g_param_spec_string ("server", "server",
      "Server",
      "",
      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (oclass, PROP_SERVER, spec);

  tp_dbus_properties_mixin_implement_interface (oclass,
      TP_IFACE_QUARK_CHANNEL_TYPE_ROOM_LIST,
      tp_dbus_properties_mixin_getter_gobject_properties, NULL,
      room_list_props);

  g_type_class_add_private (klass, sizeof (TpTestsRoomListChanPriv));
}
Пример #2
0
static void
gabble_muc_tube_stream_class_init (
    GabbleMucTubeStreamClass *gabble_muc_tube_stream_class)
{
  TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (
      gabble_muc_tube_stream_class);

  base_class->get_interfaces = gabble_muc_tube_stream_get_interfaces;
  base_class->target_handle_type = TP_HANDLE_TYPE_ROOM;
}
static void
rakia_call_channel_class_init (
    RakiaCallChannelClass *rakia_call_channel_class)
{
  GObjectClass *object_class = G_OBJECT_CLASS (rakia_call_channel_class);
  TpBaseChannelClass *base_channel_class =
      TP_BASE_CHANNEL_CLASS (rakia_call_channel_class);
  TpBaseCallChannelClass *base_call_class =
      TP_BASE_CALL_CHANNEL_CLASS (rakia_call_channel_class);
  TpBaseMediaCallChannelClass *base_media_call_class =
      TP_BASE_MEDIA_CALL_CHANNEL_CLASS (rakia_call_channel_class);
  GParamSpec *param_spec;

  g_type_class_add_private (rakia_call_channel_class,
      sizeof (RakiaCallChannelPrivate));

  object_class->constructed = rakia_call_channel_constructed;
  object_class->get_property = rakia_call_channel_get_property;
  object_class->set_property = rakia_call_channel_set_property;

  object_class->dispose = rakia_call_channel_dispose;
  object_class->finalize = rakia_call_channel_finalize;


  base_channel_class->target_handle_type = TP_HANDLE_TYPE_CONTACT;
  base_channel_class->get_object_path_suffix =
      rakia_call_channel_get_object_path_suffix;
  base_channel_class->close = rakia_call_channel_close;

  base_call_class->add_content = rakia_call_channel_add_content;
  base_call_class->hangup = rakia_call_channel_hangup;
  base_call_class->set_ringing = rakia_call_channel_set_ringing;
  base_call_class->set_queued = rakia_call_channel_set_queued;
  base_call_class->is_connected = rakia_call_channel_is_connected;

  base_media_call_class->accept = rakia_call_channel_accept;
  base_media_call_class->hold_state_changed =
      rakia_call_channel_hold_state_changed;

  param_spec = g_param_spec_object ("sip-session", "RakiaSipSession object",
      "SIP session object that is used for this SIP media channel object.",
      RAKIA_TYPE_SIP_SESSION,
      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_SIP_SESSION, param_spec);

  param_spec = g_param_spec_string ("stun-server", "STUN server",
      "IP or address of STUN server.", NULL,
      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_STUN_SERVER, param_spec);

  param_spec = g_param_spec_uint ("stun-port", "STUN port",
      "UDP port of STUN server.", 0, G_MAXUINT16, 0,
      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_STUN_PORT, param_spec);
}
Пример #4
0
static GPtrArray *
gabble_muc_tube_stream_get_interfaces (TpBaseChannel *base)
{
  GPtrArray *interfaces;

  interfaces = TP_BASE_CHANNEL_CLASS (
      gabble_muc_tube_stream_parent_class)->get_interfaces (base);

  g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_GROUP);

  return interfaces;
}
static void
rakia_call_channel_close (TpBaseChannel *base)
{
  RakiaCallChannel *self = RAKIA_CALL_CHANNEL (base);
  RakiaCallChannelPrivate *priv = self->priv;

  if (priv->session)
    rakia_sip_session_terminate (priv->session, 480, "Terminated");

  DEBUG ("Closed: %s", tp_base_channel_get_object_path (base));

  TP_BASE_CHANNEL_CLASS (rakia_call_channel_parent_class)->close (base);
}
Пример #6
0
static void
fill_immutable_properties (TpBaseChannel *chan,
    GHashTable *properties)
{
  TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS (
      tp_tests_room_list_chan_parent_class);

  klass->fill_immutable_properties (chan, properties);

  tp_dbus_properties_mixin_fill_properties_hash (
      G_OBJECT (chan), properties,
      TP_IFACE_CHANNEL_TYPE_ROOM_LIST, "Server",
      NULL);
}
Пример #7
0
    static void
fetion_im_channel_fill_immutable_properties (TpBaseChannel *chan,
        GHashTable *properties)
{
    TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS (
            fetion_im_channel_parent_class);

    klass->fill_immutable_properties (chan, properties);

    tp_dbus_properties_mixin_fill_properties_hash (
            G_OBJECT (chan), properties,
            TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessagePartSupportFlags",
            TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "DeliveryReportingSupport",
            TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes",
            TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessageTypes",
            NULL);
}
Пример #8
0
static void
lwqq_channel_class_init (LwqqChannelClass *self_class)
{
   GObjectClass *object_class = G_OBJECT_CLASS (self_class);
   TpBaseChannelClass* base_class = TP_BASE_CHANNEL_CLASS(self_class);

   g_type_class_add_private (self_class, sizeof (LwqqChannelPrivate));
   object_class->finalize = (void (*) (GObject *object)) lwqq_channel_finalize;

   base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT;
   base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT;
   base_class->interfaces = im_channel_interfaces;
   base_class->close = im_channel_close;
   base_class->fill_immutable_properties = fill_immutable_properties;

   tp_message_mixin_init_dbus_properties(object_class);
}
Пример #9
0
static void
gabble_server_sasl_channel_fill_immutable_properties (TpBaseChannel *channel,
    GHashTable *properties)
{
  TP_BASE_CHANNEL_CLASS (gabble_server_sasl_channel_parent_class)
    ->fill_immutable_properties (channel, properties);

  tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT (channel),
      properties,
      TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION, "AuthenticationMethod",
      TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION,
          "AvailableMechanisms",
      TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "HasInitialData",
      TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "CanTryAgain",
      TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION,
          "AuthorizationIdentity",
      TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "DefaultRealm",
      TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION,
          "DefaultUsername",
      TP_IFACE_CHANNEL_INTERFACE_SECURABLE, "Encrypted",
      TP_IFACE_CHANNEL_INTERFACE_SECURABLE, "Verified",
      NULL);
}
Пример #10
0
static void
gabble_server_sasl_channel_class_init (GabbleServerSaslChannelClass *klass)
{
  static TpDBusPropertiesMixinPropImpl server_auth_props[] = {
    { "AuthenticationMethod", "auth-method", NULL },
    { NULL }
  };
  static TpDBusPropertiesMixinPropImpl sasl_auth_props[] = {
    { "AvailableMechanisms", "available-mechanisms", NULL },
    { "HasInitialData", "has-initial-data", NULL },
    { "CanTryAgain", "can-try-again", NULL },
    { "SASLStatus", "sasl-status", NULL },
    { "SASLError", "sasl-error", NULL },
    { "SASLErrorDetails", "sasl-error-details", NULL },
    { "AuthorizationIdentity", "authorization-identity", NULL },
    { "DefaultRealm", "default-realm", NULL },
    { "DefaultUsername", "default-username", NULL },
    { NULL }
  };
  static TpDBusPropertiesMixinPropImpl securable_props[] = {
    /* For the moment we only have a unified "secure" property, which
     * implies we're both encrypted and verified */
    { "Encrypted", "secure", NULL },
    { "Verified", "secure", NULL },
    { NULL }
  };
  static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
      { TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION,
        tp_dbus_properties_mixin_getter_gobject_properties,
        NULL,
        server_auth_props,
      },
      { TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION,
        tp_dbus_properties_mixin_getter_gobject_properties,
        NULL,
        sasl_auth_props,
      },
      { TP_IFACE_CHANNEL_INTERFACE_SECURABLE,
        tp_dbus_properties_mixin_getter_gobject_properties,
        NULL,
        securable_props,
      },
      { NULL }
  };
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  TpBaseChannelClass *channel_class = TP_BASE_CHANNEL_CLASS (klass);
  GParamSpec *param_spec;

  g_type_class_add_private (klass, sizeof (GabbleServerSaslChannelPrivate));

  object_class->get_property = gabble_server_sasl_channel_get_property;
  object_class->set_property = gabble_server_sasl_channel_set_property;
  object_class->finalize = gabble_server_sasl_channel_finalize;

  channel_class->channel_type =
    TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION;
  channel_class->interfaces = gabble_server_sasl_channel_interfaces;
  channel_class->target_handle_type = TP_HANDLE_TYPE_NONE;
  channel_class->fill_immutable_properties =
    gabble_server_sasl_channel_fill_immutable_properties;
  channel_class->get_object_path_suffix =
    gabble_server_sasl_channel_get_object_path_suffix;
  channel_class->close = gabble_server_sasl_channel_close;

  param_spec = g_param_spec_string ("auth-method",
      "Authentication method",
      "Method of authentication (D-Bus interface)",
      TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION,
      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_AUTH_METHOD,
      param_spec);

  param_spec = g_param_spec_string ("authorization-identity",
      "AuthorizationIdentity",
      "Identity for which we wish to be authorized",
      NULL,
      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_AUTHORIZATION_IDENTITY,
      param_spec);

  param_spec = g_param_spec_string ("default-realm",
      "DefaultRealm",
      "Default realm if the server does not supply one",
      NULL,
      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_DEFAULT_REALM,
      param_spec);

  param_spec = g_param_spec_string ("default-username",
      "DefaultUsername",
      "Default simple username if the user does not supply one",
      NULL,
      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_DEFAULT_USERNAME,
      param_spec);

  param_spec = g_param_spec_uint ("sasl-status", "SASLStatus",
      "Status of this channel",
      0, NUM_TP_SASL_STATUSES, 0,
      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_SASL_STATUS,
      param_spec);

  param_spec = g_param_spec_string ("sasl-error", "SASLError",
      "D-Bus error name",
      "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_SASL_ERROR,
      param_spec);

  param_spec = g_param_spec_boxed ("sasl-error-details", "SASLErrorDetails",
      "Extra details of a SASL error",
      TP_HASH_TYPE_STRING_VARIANT_MAP,
      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_SASL_ERROR_DETAILS,
      param_spec);

  param_spec = g_param_spec_boxed ("available-mechanisms",
      "Available authentication mechanisms",
      "The set of mechanisms the server advertised.",
      G_TYPE_STRV,
      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_AVAILABLE_MECHANISMS,
      param_spec);

  param_spec = g_param_spec_boolean ("can-try-again", "CanTryAgain",
      "True if failed SASL can be retried without reconnecting",
      FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_CAN_TRY_AGAIN,
      param_spec);

  param_spec = g_param_spec_boolean ("has-initial-data", "HasInitialData",
      "True if SASL has initial data",
      TRUE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_HAS_INITIAL_DATA,
      param_spec);

  param_spec = g_param_spec_boolean ("secure",
      "Is secure",
      "Is this channel secure (encrypted and verified)?",
      FALSE,
      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_SECURE,
      param_spec);

  klass->dbus_props_class.interfaces = prop_interfaces;
  tp_dbus_properties_mixin_class_init (object_class,
      G_STRUCT_OFFSET (GabbleServerSaslChannelClass, dbus_props_class));
}