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

@@ -7,7 +7,7 @@
#include <cmocka.h>
#include <sys/stat.h>
#include "config.h"
#include "prof_config.h"
#include "proftest.h"
#include "test_connect.h"

View File

@@ -798,7 +798,7 @@ void cmd_account_set_priority_updates_presence_when_account_connected_with_prese
will_return(jabber_get_account_name, "a_account");
#ifdef HAVE_LIBGPGME
#ifdef PROF_HAVE_LIBGPGME
ProfAccount *account = account_new("a_account", "a_jid", NULL, NULL, TRUE, NULL, 5222, "a_resource",
NULL, NULL, 10, 10, 10, 10, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

View File

@@ -6,9 +6,9 @@
#include <string.h>
#include <glib.h>
#include "config.h"
#include "prof_config.h"
#ifdef HAVE_LIBOTR
#ifdef PROF_HAVE_LIBOTR
#include <libotr/proto.h>
#include "otr/otr.h"
#endif
@@ -24,7 +24,7 @@
#define CMD_OTR "/otr"
#ifdef HAVE_LIBOTR
#ifdef PROF_HAVE_LIBOTR
void cmd_otr_shows_usage_when_no_args(void **state)
{
gchar *args[] = { NULL };

View File

@@ -1,6 +1,6 @@
#include "config.h"
#include "prof_config.h"
#ifdef HAVE_LIBOTR
#ifdef PROF_HAVE_LIBOTR
void cmd_otr_shows_usage_when_no_args(void **state);
void cmd_otr_shows_usage_when_invalid_subcommand(void **state);
void cmd_otr_log_shows_usage_when_no_args(void **state);

View File

@@ -6,7 +6,7 @@
#include <string.h>
#include <glib.h>
#include "config.h"
#include "prof_config.h"
#include "command/commands.h"
@@ -14,7 +14,7 @@
#define CMD_PGP "/pgp"
#ifdef HAVE_LIBGPGME
#ifdef PROF_HAVE_LIBGPGME
void cmd_pgp_shows_usage_when_no_args(void **state)
{
gchar *args[] = { NULL };

View File

@@ -1,6 +1,6 @@
#include "config.h"
#include "prof_config.h"
#ifdef HAVE_LIBGPGME
#ifdef PROF_HAVE_LIBGPGME
void cmd_pgp_shows_usage_when_no_args(void **state);
void cmd_pgp_start_shows_message_when_disconnected(void **state);
void cmd_pgp_start_shows_message_when_disconnecting(void **state);

View File

@@ -1,4 +1,4 @@
#include "config.h"
#include "prof_config.h"
#include <glib.h>
#include <wchar.h>
@@ -8,7 +8,7 @@
#include "ui/window.h"
#include "ui/ui.h"
#ifdef HAVE_LIBOTR
#ifdef PROF_HAVE_LIBOTR
#include "otr/otr.h"
#endif
@@ -67,7 +67,7 @@ void ui_resize(void) {}
void ui_focus_win(ProfWin *win) {}
#ifdef HAVE_LIBOTR
#ifdef PROF_HAVE_LIBOTR
void chatwin_otr_secured(ProfChatWin *chatwin, gboolean trusted) {}
void chatwin_otr_unsecured(ProfChatWin *chatwin) {}
void chatwin_otr_trust(ProfChatWin *chatwin) {}
@@ -303,8 +303,10 @@ gboolean ui_win_has_unsaved_form(int num)
return FALSE;
}
void
ui_write(char *line, int offset) {}
void ui_status_bar_inactive(const int win) {}
void ui_status_bar_active(const int win) {}
void ui_status_bar_new(const int win) {}
void ui_write(char *line, int offset) {}
// console window actions
@@ -494,6 +496,10 @@ ProfWin* win_create_private(const char * const fulljid)
{
return NULL;
}
ProfWin* win_create_plugin(const char * const tag)
{
return NULL;
}
void win_update_virtual(ProfWin *window) {}
void win_free(ProfWin *window) {}
@@ -540,3 +546,6 @@ void notify_remind(void) {}
void notify_invite(const char * const from, const char * const room,
const char * const reason) {}
void notify_subscription(const char * const from) {}
void notify(const char * const message, int timeout,
const char * const category) {}

View File

@@ -7,9 +7,8 @@
#include <cmocka.h>
#include <sys/stat.h>
#include "config.h"
#include "prof_config.h"
#include "chat_session.h"
#include "helpers.h"
#include "test_autocomplete.h"
#include "test_chat_session.h"
@@ -356,7 +355,7 @@ int main(int argc, char* argv[]) {
unit_test(cmd_account_set_eval_password_when_password_set),
unit_test(cmd_account_set_muc_sets_muc),
unit_test(cmd_account_set_nick_sets_nick),
#ifdef HAVE_LIBOTR
#ifdef PROF_HAVE_LIBOTR
unit_test(cmd_account_show_message_for_missing_otr_policy),
unit_test(cmd_account_show_message_for_invalid_otr_policy),
unit_test(cmd_account_set_otr_sets_otr),
@@ -505,7 +504,7 @@ int main(int argc, char* argv[]) {
unit_test(cmd_bookmark_remove_removes_bookmark),
unit_test(cmd_bookmark_remove_shows_message_when_no_bookmark),
#ifdef HAVE_LIBOTR
#ifdef PROF_HAVE_LIBOTR
unit_test(cmd_otr_shows_usage_when_no_args),
unit_test(cmd_otr_shows_usage_when_invalid_subcommand),
unit_test(cmd_otr_log_shows_usage_when_no_args),
@@ -557,7 +556,7 @@ int main(int argc, char* argv[]) {
unit_test(cmd_otr_shows_message_when_otr_unsupported),
#endif
#ifdef HAVE_LIBGPGME
#ifdef PROF_HAVE_LIBGPGME
unit_test(cmd_pgp_shows_usage_when_no_args),
unit_test(cmd_pgp_start_shows_message_when_disconnected),
unit_test(cmd_pgp_start_shows_message_when_disconnecting),