Changeset - 0d46e7f53ec6
[Not reviewed]
0 3 0
HanzZ - 13 years ago 2012-04-03 20:38:25
hanzz.k@gmail.com
execute_purple_plugin_action
3 files changed with 28 insertions and 20 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -1448,25 +1448,8 @@ static void signed_on(PurpleConnection *gc, gpointer unused) {
 
	malloc_trim(0);
 
#endif
 

	
 
	PurplePlugin *plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL;
 
	if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) {
 
		PurplePluginAction *action = NULL;
 
		GList *actions, *l;
 

	
 
		actions = PURPLE_PLUGIN_ACTIONS(plugin, gc);
 

	
 
		for (l = actions; l != NULL; l = l->next) {
 
			if (l->data) {
 
				action = (PurplePluginAction *) l->data;
 
				action->plugin = plugin;
 
				action->context = gc;
 
				if ((std::string) action->label == "Download buddylist from Server") {
 
					action->callback(action);
 
				}
 
				purple_plugin_action_free(action);
 
			}
 
		}
 
	}
 
	// For prpl-gg
 
	execute_purple_plugin_action(gc, "Download buddylist from Server");
 
}
 

	
 
static void printDebug(PurpleDebugLevel level, const char *category, const char *arg_s) {
backends/libpurple/utils.cpp
Show inline comments
 
@@ -49,6 +49,28 @@
 

	
 
static GHashTable *ui_info = NULL;
 

	
 
void execute_purple_plugin_action(PurpleConnection *gc, const std::string &name) {
 
	PurplePlugin *plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL;
 
	if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) {
 
		PurplePluginAction *action = NULL;
 
		GList *actions, *l;
 

	
 
		actions = PURPLE_PLUGIN_ACTIONS(plugin, gc);
 

	
 
		for (l = actions; l != NULL; l = l->next) {
 
			if (l->data) {
 
				action = (PurplePluginAction *) l->data;
 
				action->plugin = plugin;
 
				action->context = gc;
 
				if ((std::string) action->label == name) {
 
					action->callback(action);
 
				}
 
				purple_plugin_action_free(action);
 
			}
 
		}
 
	}
 
}
 

	
 
GHashTable *spectrum_ui_get_info(void)
 
{
 
	if(NULL == ui_info) {
backends/libpurple/utils.h
Show inline comments
 
@@ -21,10 +21,13 @@
 
#pragma once
 

	
 
#include "purple.h"
 
#include <string>
 

	
 
#ifndef WIN32
 
void spectrum_sigchld_handler(int sig);
 
#endif
 

	
 
int create_socket(char *host, int portno);
 
GHashTable *spectrum_ui_get_info(void);
 
\ No newline at end of file
 
GHashTable *spectrum_ui_get_info(void);
 

	
 
void execute_purple_plugin_action(PurpleConnection *gc, const std::string &name);
0 comments (0 inline, 0 general)