1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00
profanity/tests/unittests/otr/stub_otr.c

165 lines
2.2 KiB
C
Raw Normal View History

#include <libotr/proto.h>
#include <libotr/message.h>
#include <glib.h>
2014-12-24 18:32:32 -05:00
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
2014-12-24 18:32:32 -05:00
#include "config/account.h"
#include "otr/otr.h"
2020-07-07 08:18:57 -04:00
OtrlUserState
otr_userstate(void)
2014-12-24 18:32:32 -05:00
{
return NULL;
}
2020-07-07 08:18:57 -04:00
OtrlMessageAppOps*
otr_messageops(void)
2014-12-24 18:32:32 -05:00
{
return NULL;
}
2020-07-07 08:18:57 -04:00
GHashTable*
otr_smpinitators(void)
2014-12-24 18:32:32 -05:00
{
return NULL;
}
2020-07-07 08:18:57 -04:00
void
otr_init(void)
{
}
void
otr_shutdown(void)
{
}
2014-12-24 18:32:32 -05:00
2020-07-07 08:18:57 -04:00
char*
otr_libotr_version(void)
2014-12-24 18:32:32 -05:00
{
return mock_ptr_type(char*);
2014-12-24 18:32:32 -05:00
}
2020-07-07 08:18:57 -04:00
char*
otr_start_query(void)
2014-12-24 18:32:32 -05:00
{
return mock_ptr_type(char*);
2014-12-24 18:32:32 -05:00
}
2020-07-07 08:18:57 -04:00
void
otr_poll(void)
{
}
void
otr_on_connect(ProfAccount* account)
{
}
char*
otr_on_message_recv(const char* const barejid, const char* const resource, const char* const message, gboolean* was_decrypted)
{
return NULL;
}
2020-07-07 08:18:57 -04:00
gboolean
otr_on_message_send(ProfChatWin* chatwin, const char* const message, gboolean request_receipt, const char* const replace_id)
2015-06-20 20:48:25 -04:00
{
return FALSE;
}
2014-12-24 18:32:32 -05:00
2020-07-07 08:18:57 -04:00
void
otr_keygen(ProfAccount* account)
2014-12-24 18:32:32 -05:00
{
check_expected(account);
}
2020-07-07 08:18:57 -04:00
gboolean
otr_key_loaded(void)
2014-12-24 18:32:32 -05:00
{
2019-05-08 15:52:16 -04:00
return mock_type(gboolean);
2014-12-24 18:32:32 -05:00
}
2020-07-07 08:18:57 -04:00
char*
otr_tag_message(const char* const msg)
{
return NULL;
}
2020-07-07 08:18:57 -04:00
gboolean
otr_is_secure(const char* const recipient)
2014-12-24 18:32:32 -05:00
{
return FALSE;
}
2020-07-07 08:18:57 -04:00
gboolean
otr_is_trusted(const char* const recipient)
2014-12-24 18:32:32 -05:00
{
return FALSE;
}
2020-07-07 08:18:57 -04:00
void
otr_trust(const char* const recipient)
{
}
void
otr_untrust(const char* const recipient)
{
}
2014-12-24 18:32:32 -05:00
2020-07-07 08:18:57 -04:00
void
otr_smp_secret(const char* const recipient, const char* secret)
{
}
void
otr_smp_question(const char* const recipient, const char* question, const char* answer)
{
}
void
otr_smp_answer(const char* const recipient, const char* answer)
{
}
2014-12-24 18:32:32 -05:00
2020-07-07 08:18:57 -04:00
void
otr_end_session(const char* const recipient)
{
}
2014-12-24 18:32:32 -05:00
2020-07-07 08:18:57 -04:00
char*
otr_get_my_fingerprint(void)
2014-12-24 18:32:32 -05:00
{
2020-07-07 08:18:57 -04:00
return mock_ptr_type(char*);
2014-12-24 18:32:32 -05:00
}
2020-07-07 08:18:57 -04:00
char*
otr_get_their_fingerprint(const char* const recipient)
2014-12-24 18:32:32 -05:00
{
check_expected(recipient);
2020-07-07 08:18:57 -04:00
return mock_ptr_type(char*);
2014-12-24 18:32:32 -05:00
}
2020-07-07 08:18:57 -04:00
char*
otr_encrypt_message(const char* const to, const char* const message)
2014-12-24 18:32:32 -05:00
{
return NULL;
}
2020-07-07 08:18:57 -04:00
char*
otr_decrypt_message(const char* const from, const char* const message,
gboolean* was_decrypted)
2014-12-24 18:32:32 -05:00
{
return NULL;
}
2020-07-07 08:18:57 -04:00
void
otr_free_message(char* message)
{
}
2014-12-24 18:32:32 -05:00
2020-07-07 08:18:57 -04:00
prof_otrpolicy_t
otr_get_policy(const char* const recipient)
2014-12-24 18:32:32 -05:00
{
return PROF_OTRPOLICY_MANUAL;
}