Ejemplo n.º 1
0
	void ProtoManager::PluginsAvailable ()
	{
		purple_debug_set_enabled (true);

		const auto& dir = Util::CreateIfNotExists ("azoth/velvetbird/purple");
		purple_util_set_user_dir (dir.absolutePath ().toUtf8 ().constData ());

		purple_core_set_ui_ops (&UiOps);
		purple_eventloop_set_ui_ops (&EvLoopOps);
		purple_idle_set_ui_ops (&IdleOps);
		purple_connections_set_ui_ops (&ConnUiOps);

		purple_set_blist (purple_blist_new ());
		purple_blist_set_ui_data (this);
		purple_blist_set_ui_ops (&BListUiOps);

		purple_conversations_set_ui_ops (&ConvUiOps);
		purple_accounts_set_ui_ops (&AccUiOps);
		purple_notify_set_ui_ops (&NotifyUiOps);

		purple_imgstore_init ();
		purple_buddy_icons_init ();

		if (!purple_core_init ("leechcraft.azoth"))
		{
			qWarning () << Q_FUNC_INFO
					<< "failed initializing libpurple";
			return;
		}

		QMap<QByteArray, Protocol_ptr> id2proto;

		auto protos = purple_plugins_get_protocols ();
		while (protos)
		{
			auto item = static_cast<PurplePlugin*> (protos->data);
			protos = protos->next;

			const auto& proto = std::make_shared<Protocol> (item, Proxy_);
			const auto& purpleId = proto->GetPurpleID ();

			if (purpleId == "prpl-jabber" || purpleId == "prpl-irc")
				continue;

			Protocols_ << proto;
			id2proto [purpleId] = proto;
		}

		auto accs = purple_accounts_get_all ();
		while (accs)
		{
			auto acc = static_cast<PurpleAccount*> (accs->data);
			accs = accs->next;

			id2proto [purple_account_get_protocol_id (acc)]->PushAccount (acc);
		}

		purple_blist_load ();
		purple_savedstatus_activate (purple_savedstatus_get_startup ());
	}
Ejemplo n.º 2
0
xmlnode * _h_elim_init ( const char *name ,
                         const char *id   ,
                         SEXP_VALUE *args ,
                         gpointer data    )
{
    ASSERT_ALISTP( args, id, name );

    char    *dir = ALIST_VAL_STRING( args, "dot-dir" );
    char    *ui  = ALIST_VAL_STRING( args, "ui-id"   );
    gboolean dbg = ALIST_VAL_BOOL  ( args, "debug"   );

    if( !ui ) { ui = "elim"; }

    // libpurple initialisation:
    purple_util_set_user_dir       ( dir  );
    purple_util_init               ();
    purple_core_set_ui_ops         ( &elim_core_ui_ops         );
    purple_eventloop_set_ui_ops    ( &elim_eventloop_ui_ops    );
    purple_blist_set_ui_ops        ( &elim_blist_ui_ops        );
    purple_accounts_set_ui_ops     ( &elim_account_ui_ops      );
    purple_request_set_ui_ops      ( &elim_request_ui_ops      );
    purple_idle_set_ui_ops         ( &elim_idle_ui_ops         );
    purple_connections_set_ui_ops  ( &elim_connections_ui_ops  );
    purple_conversations_set_ui_ops( &elim_conversation_ui_ops );
    purple_notify_set_ui_ops       ( &elim_notify_ui_ops       );

    // load any data for init:    
    if( purple_get_core() == NULL )
    {
        // purple debug goes to stdout if we don't divert it here:
        g_set_print_handler( (GPrintFunc)_h_elim_warning );
        // look for plugins in user specified directory tree:
        char *ppath = g_build_filename( purple_user_dir(), "plugins", NULL );
        purple_plugins_add_search_path ( ppath );
        purple_debug_set_enabled( dbg );
        purple_core_init ( ui );
        purple_set_blist ( purple_blist_new() );
        purple_prefs_load();
        purple_blist_load();
        // glib signal initialisation:
        elim_ft_signals_init();
        // tidy up:
        g_free( ppath );
    }
    else
    {
        const char *cur_ui = purple_core_get_ui();
        if( strcmp( cur_ui, name ) )
        {
            sexp_val_free( args );
            return response_error( EINVAL, id, name, 
                                   "purple has already been initialised" );
        }
    }

    sexp_val_free( args );
    xmlnode *rval = xnode_new( "alist" );
    AL_STR( rval, "ui-id", purple_core_get_ui() );
    return response_value( 0, id, name, rval );
}
static void null_ui_init(void)
{
      /**
       * This should initialize the UI components for all the modules. Here we
       * just initialize the UI for conversations.
       */
      purple_conversations_set_ui_ops(&null_conv_uiops);
}
Ejemplo n.º 4
0
static void null_ui_init(void)
{
	/**
	 * This should initialize the UI components for all the modules.
	 */
	purple_conversations_set_ui_ops(null_conv_get_ui_ops());
    purple_blist_set_ui_ops(null_blist_get_ui_ops());
}
Ejemplo n.º 5
0
static void taim_ui_init() {
  printf("taim_ui_init\n");
  /**
   * This should initialize the UI components for all the modules. Here we
   * just initialize the UI for conversations.
   */
  purple_conversations_set_ui_ops(&taim_conv_uiops);
}
Ejemplo n.º 6
0
/* API: purple.conversations.init(uiops) */
static int conversations_init(LuaState *L)
{
    conversations_uiops_lua = ms_lua_var_new_type(L, 1, LUA_TTABLE);

    purple_conversations_set_ui_ops(&conversations_uiops);
    purple_conversations_init();

    return 0;
}
Ejemplo n.º 7
0
static void purple_ui_init()
{
	purple_connections_set_ui_ops( &bee_conn_uiops );
	purple_blist_set_ui_ops( &bee_blist_uiops );
	purple_conversations_set_ui_ops( &bee_conv_uiops );
	purple_request_set_ui_ops( &bee_request_uiops );
	purple_privacy_set_ui_ops( &bee_privacy_uiops );
	purple_notify_set_ui_ops( &bee_notify_uiops );
	purple_accounts_set_ui_ops( &bee_account_uiops );
	purple_xfers_set_ui_ops( &bee_xfer_uiops );
	
	if( getenv( "BITLBEE_DEBUG" ) )
		purple_debug_set_ui_ops( &bee_debug_uiops );
}
Ejemplo n.º 8
0
void IMInvoker::purpleUIInit(void) {
	purple_accounts_set_ui_ops(&_uiAccountOps);
//	purple_xfers_set_ui_ops(&_uiXferOps);
//	purple_blist_set_ui_ops(&_uiBuddyOps);
//	purple_notify_set_ui_ops(&_uiNotifyOps);
//	purple_privacy_set_ui_ops(&_uiPrivacyOps);
//	purple_request_set_ui_ops(&_uiRequestOps);
//	purple_connections_set_ui_ops(&_uiConnectOps);
//	purple_whiteboard_set_ui_ops(&_uiWhiteboardOps);
	purple_conversations_set_ui_ops(&_uiConvOps);
	purple_debug_set_ui_ops(&_uiDebugOps);

	setupPurpleSignals();

}
Ejemplo n.º 9
0
void finch_ui_uninit()
{
	purple_accounts_set_ui_ops(NULL);
	finch_accounts_uninit();

	purple_connections_set_ui_ops(NULL);
	finch_connections_uninit();

	purple_blist_set_ui_ops(NULL);
	finch_blist_uninit();

	purple_conversations_set_ui_ops(NULL);
	finch_conversation_uninit();

	purple_notify_set_ui_ops(NULL);
	finch_notify_uninit();

	purple_request_set_ui_ops(NULL);
	finch_request_uninit();

	finch_pounces_uninit();

	finch_log_uninit();

	finch_xfers_uninit();
	purple_xfers_set_ui_ops(NULL);

	finch_roomlist_uninit();
	purple_roomlist_set_ui_ops(NULL);

#ifdef USE_VV
	finch_media_manager_uninit();
#endif

	gnt_quit();

#ifdef _WIN32
	gnt_set_config_dir(NULL);
#endif /* _WIN32 */
#endif /* STANDALONE */
}
Ejemplo n.º 10
0
void gnt_ui_uninit()
{
	purple_accounts_set_ui_ops(NULL);
	finch_accounts_uninit();

	purple_connections_set_ui_ops(NULL);
	finch_connections_uninit();

	purple_blist_set_ui_ops(NULL);
	finch_blist_uninit();

	purple_conversations_set_ui_ops(NULL);
	finch_conversation_uninit();

	purple_notify_set_ui_ops(NULL);
	finch_notify_uninit();

	purple_request_set_ui_ops(NULL);
	finch_request_uninit();

	finch_pounces_uninit();

	finch_log_uninit();

	finch_xfers_uninit();
	purple_xfers_set_ui_ops(NULL);

	finch_roomlist_uninit();
	purple_roomlist_set_ui_ops(NULL);

#ifdef USE_VV
	finch_media_manager_uninit();
#endif

	gnt_quit();
#endif
}
Ejemplo n.º 11
0
void gnt_ui_init()
{
#ifdef STANDALONE
	gnt_init();
#endif

	purple_prefs_add_none("/purple/gnt");
	
	/* Accounts */
	finch_accounts_init();
	purple_accounts_set_ui_ops(finch_accounts_get_ui_ops());

	/* Connections */
	finch_connections_init();
	purple_connections_set_ui_ops(finch_connections_get_ui_ops());

	/* Initialize the buddy list */
	finch_blist_init();
	purple_blist_set_ui_ops(finch_blist_get_ui_ops());

	/* Initialize sound */
	purple_sound_set_ui_ops(finch_sound_get_ui_ops());

	/* Now the conversations */
	finch_conversation_init();
	purple_conversations_set_ui_ops(finch_conv_get_ui_ops());

	/* Notify */
	finch_notify_init();
	purple_notify_set_ui_ops(finch_notify_get_ui_ops());

	/* Request */
	finch_request_init();
	purple_request_set_ui_ops(finch_request_get_ui_ops());

	/* Pounce */
	finch_pounces_init();

	/* Log */
	finch_log_init();

	/* File transfer */
	finch_xfers_init();
	purple_xfers_set_ui_ops(finch_xfers_get_ui_ops());

	/* Roomlist */
	finch_roomlist_init();
	purple_roomlist_set_ui_ops(finch_roomlist_get_ui_ops());

	/* Media */
	finch_media_manager_init();

	gnt_register_action(_("Accounts"), finch_accounts_show_all);
	gnt_register_action(_("Buddy List"), finch_blist_show);
	gnt_register_action(_("Buddy Pounces"), finch_pounces_manager_show);
	gnt_register_action(_("Certificates"), finch_certmgr_show);
	gnt_register_action(_("Debug Window"), finch_debug_window_show);
	gnt_register_action(_("File Transfers"), finch_xfer_dialog_show);
	gnt_register_action(_("Plugins"), finch_plugins_show_all);
	gnt_register_action(_("Room List"), finch_roomlist_show_all);
	gnt_register_action(_("Sounds"), finch_sounds_show_all);
	gnt_register_action(_("Preferences"), finch_prefs_show_all);
	gnt_register_action(_("Statuses"), finch_savedstatus_show_all);

#ifdef STANDALONE
}
Ejemplo n.º 12
0
static VALUE watch_incoming_im(VALUE self)
{
  purple_conversations_set_ui_ops(&conv_uiops);
  set_callback(&im_handler, "im_handler");
  return im_handler;
}
Ejemplo n.º 13
0
static void ui_init(void) {
    purple_conversations_set_ui_ops(&conv_uiops);
}// </editor-fold>
Ejemplo n.º 14
0
void PurpleChatMngr::Init()
{
	_accountMngr = PurpleAccountMngr::getInstance();
	init_chat_event();
	purple_conversations_set_ui_ops(&chat_wg_ops);
}