Added C plugin code from plugins branch

This commit is contained in:
James Booth
2016-02-14 22:28:55 +00:00
parent f887a35c0c
commit 41fe8c22b1
70 changed files with 2668 additions and 287 deletions

View File

@@ -32,7 +32,7 @@
*
*/
#include "config.h"
#include "prof_config.h"
#include <string.h>
#include <assert.h>
@@ -201,6 +201,27 @@ wins_get_private(const char *const fulljid)
return NULL;
}
ProfPluginWin*
wins_get_plugin(const char *const tag)
{
GList *values = g_hash_table_get_values(windows);
GList *curr = values;
while (curr) {
ProfWin *window = curr->data;
if (window->type == WIN_PLUGIN) {
ProfPluginWin *pluginwin = (ProfPluginWin*)window;
if (g_strcmp0(pluginwin->tag, tag) == 0) {
return pluginwin;
}
}
curr = g_list_next(curr);
}
g_list_free(values);
return NULL;
}
GList*
wins_get_private_chats(const char *const roomjid)
{
@@ -614,6 +635,17 @@ wins_new_private(const char *const fulljid)
return newwin;
}
ProfWin *
wins_new_plugin(const char * const tag)
{
GList *keys = g_hash_table_get_keys(windows);
int result = get_next_available_win_num(keys);
ProfWin *new = win_create_plugin(tag);
g_hash_table_insert(windows, GINT_TO_POINTER(result), new);
g_list_free(keys);
return new;
}
gboolean
wins_do_notify_remind(void)
{