Ejemplo n.º 1
0
    static GObject *
constructor (GType type,
        guint n_props,
        GObjectConstructParam *props)
{
    GObject *object =
        G_OBJECT_CLASS (fetion_im_channel_parent_class)->constructor (type,
                n_props, props);
    FetionImChannel *self = FETION_IM_CHANNEL (object);
    TpBaseChannel *base = TP_BASE_CHANNEL (self);

    static TpChannelTextMessageType const types[] = {
        TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL,
        TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION,
        TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE
    };
    static const char * const content_types[] = { "text/plain", NULL };

    tp_base_channel_register (base);

    tp_message_mixin_init (object, G_STRUCT_OFFSET (FetionImChannel, text),
            tp_base_channel_get_connection (base));

    tp_message_mixin_implement_sending (object, send_message,
            G_N_ELEMENTS (types), types,0,
            TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES,
            content_types);

    return object;
}
Ejemplo n.º 2
0
static void
lwqq_channel_init (LwqqChannel *self)
{
   LwqqChannelPrivate *priv;

   priv = LWQQ_CHANNEL_GET_PRIVATE (self);
   self->priv = priv;

   TpBaseChannel* base = TP_BASE_CHANNEL(self);
   GObject* obj = G_OBJECT(self);

   static TpChannelTextMessageType const types[] = {
      TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL
   };

   static const char* const content_types[] = {"text/plain", NULL};

   tp_base_channel_register(base);

   tp_message_mixin_init(G_OBJECT(self), G_STRUCT_OFFSET(LwqqChannel, text),
         tp_base_channel_get_connection(base));

   tp_message_mixin_implement_sending(obj, send_message, G_N_ELEMENTS(types),
         types, 0, TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES,
         content_types);
}