jingle-filetransfer/filetransfer.c
changeset 62 e7915504da33
parent 60 05184a1846d1
child 63 b56853071a09
equal deleted inserted replaced
61:c7879aae9e1d 62:e7915504da33
    36 
    36 
    37 #include "filetransfer.h"
    37 #include "filetransfer.h"
    38 
    38 
    39 
    39 
    40 gconstpointer jingle_ft_check(JingleContent *cn, GError **err);
    40 gconstpointer jingle_ft_check(JingleContent *cn, GError **err);
       
    41 void jingle_ft_handle(gconstpointer data, LmMessageNode *node);
       
    42 gboolean jingle_ft_handle_data(gconstpointer data, const gchar *data2, guint len);
    41 static gboolean is_md5_hash(const gchar *hash);
    43 static gboolean is_md5_hash(const gchar *hash);
    42 static void jingle_ft_init(void);
    44 static void jingle_ft_init(void);
    43 static void jingle_ft_uninit(void);
    45 static void jingle_ft_uninit(void);
    44 
    46 
    45 
    47 
    46 const gchar *deps[] = { "jingle", NULL };
    48 const gchar *deps[] = { "jingle", NULL };
    47 
    49 
    48 JingleAppFuncs funcs = {jingle_ft_check, NULL};
    50 JingleAppFuncs funcs = {
       
    51   jingle_ft_check,
       
    52   jingle_ft_handle,
       
    53   jingle_ft_handle_data
       
    54 };
    49 
    55 
    50 module_info_t info_jingle_filetransfer = {
    56 module_info_t info_jingle_filetransfer = {
    51   .branch          = MCABBER_BRANCH,
    57   .branch          = MCABBER_BRANCH,
    52   .api             = MCABBER_API_VERSION,
    58   .api             = MCABBER_API_VERSION,
    53   .version         = PROJECT_VERSION,
    59   .version         = PROJECT_VERSION,
   136   ft->hash = g_strndup(ft->hash, 32);
   142   ft->hash = g_strndup(ft->hash, 32);
   137 
   143 
   138   return (gconstpointer) ft;
   144   return (gconstpointer) ft;
   139 }
   145 }
   140 
   146 
   141 static gboolean is_md5_hash(const gchar *hash) {
   147 void jingle_ft_handle(gconstpointer data, LmMessageNode *node)
       
   148 {
       
   149   return;
       
   150 }
       
   151 
       
   152 gboolean jingle_ft_handle_data(gconstpointer data, const gchar *data2, guint len)
       
   153 {
       
   154   return FALSE;
       
   155 }
       
   156 
       
   157 static gboolean is_md5_hash(const gchar *hash)
       
   158 {
   142   int i = 0;
   159   int i = 0;
   143   for (i = 0; i < 32 && hash[i]; i++)
   160   for (i = 0; i < 32 && hash[i]; i++)
   144     if (!g_ascii_isxdigit(hash[i])) break;
   161     if (!g_ascii_isxdigit(hash[i])) break;
   145 
   162 
   146   if (i == 32)
   163   if (i == 32)