rename key visualization function

This commit is contained in:
mjentsch 2015-05-24 00:23:28 +02:00
parent c3abf27376
commit b5fb8df3b7
4 changed files with 8 additions and 4 deletions

View file

@ -39,9 +39,9 @@
#include "msglog.h"
#include "tgp-2prpl.h"
#include "tgp-structs.h"
#include "tgp-utils.h"
#include "lodepng/lodepng.h"
#define _(m) m
#define DC_SERIALIZED_MAGIC 0x868aa81d
#define STATE_FILE_MAGIC 0x28949a93
@ -637,7 +637,7 @@ void telegram_login (struct tgl_state *TLS) {
/**
* This function generates a png image to visualize the sha1 key from an encrypted chat.
*/
int generate_ident_icon (struct tgl_state *TLS, unsigned char* sha1_key) {
int tgp_visualize_key (struct tgl_state *TLS, unsigned char* sha1_key) {
int colors[4] = {
0xffffff,
0xd5e6f3,

View file

@ -33,7 +33,6 @@ void write_secret_chat_gw (struct tgl_state *TLS, void *extra, int success, stru
void telegram_login (struct tgl_state *TLS);
void request_code_entered (gpointer data, const gchar *code);
int generate_ident_icon(struct tgl_state *TLS, unsigned char* sha1_key);
void request_accept_secret_chat (struct tgl_state *TLS, struct tgl_secret_chat *U);
@ -41,4 +40,6 @@ gchar *get_config_dir (struct tgl_state *TLS, char const *username);
gchar *get_download_dir (struct tgl_state *TLS);
void assert_file_exists (PurpleConnection *gc, const char *filepath, const char *format);
int tgp_visualize_key(struct tgl_state *TLS, unsigned char* sha1_key);
#endif

View file

@ -390,7 +390,7 @@ PurpleNotifyUserInfo *p2tgl_notify_encrypted_chat_info_new (struct tgl_state *TL
}
if (secret->first_key_sha[0]) {
int sha1key_store_id = generate_ident_icon (TLS, secret->first_key_sha);
int sha1key_store_id = tgp_visualize_key (TLS, secret->first_key_sha);
if (sha1key_store_id != -1) {
char *ident_icon = format_img_full (sha1key_store_id);
purple_notify_user_info_add_pair (info, "Secret key", ident_icon);

View file

@ -23,6 +23,9 @@
#endif
#include "tgp-utils.h"
#include "msglog.h"
#include "lodepng/lodepng.h"
#include <purple.h>
#ifdef HAVE_LIBWEBP
#include <webp/decode.h>