From 08168c63390a917217d5330260e532a930b8c544 Mon Sep 17 00:00:00 2001 From: mjentsch Date: Sun, 4 Oct 2015 16:58:25 +0200 Subject: [PATCH] Include translation functions and restructure includes --- telegram-base.c | 1 - telegram-purple.c | 5 +---- telegram-purple.h | 23 +++++++++++++++++------ tgp-2prpl.c | 5 +---- tgp-msg.c | 6 +----- tgp-request.c | 5 ++--- 6 files changed, 22 insertions(+), 23 deletions(-) diff --git a/telegram-base.c b/telegram-base.c index 15a7d8b..2ea770d 100644 --- a/telegram-base.c +++ b/telegram-base.c @@ -46,7 +46,6 @@ #include "tgp-request.h" #include "lodepng/lodepng.h" -#define _(m) m #define DC_SERIALIZED_MAGIC 0x868aa81d #define STATE_FILE_MAGIC 0x28949a93 #define SECRET_CHAT_FILE_MAGIC 0x37a1988a diff --git a/telegram-purple.c b/telegram-purple.c index 4aa2303..b67d260 100644 --- a/telegram-purple.c +++ b/telegram-purple.c @@ -18,9 +18,7 @@ Copyright Matthias Jentsch, Vitaly Valtman, Christopher Althaus, Markus Endres 2014-2015 */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "telegram-purple.h" #include #include @@ -64,7 +62,6 @@ #include "msglog.h" #include "telegram-base.h" -#include "telegram-purple.h" #include "tgp-structs.h" #include "tgp-2prpl.h" #include "tgp-net.h" diff --git a/telegram-purple.h b/telegram-purple.h index a4537d3..af30d7b 100644 --- a/telegram-purple.h +++ b/telegram-purple.h @@ -20,18 +20,29 @@ #ifndef __TG_PURPLE_H__ #define __TG_PURPLE_H__ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +// Define macros for gettext translation, ENABLE_NLS should be set if configure has detected +// libintl.h. If this is not the case a dummy macro is defined to bypass the translation functions +#ifdef ENABLE_NLS +# include +#elseif +# define _(String) String +#endif + #include - -#define PLUGIN_ID "prpl-telegram" -#define TG_AUTHOR "Matthias Jentsch , Vitaly Valtman, Christopher Althaus , Markus Endres . Based on libtgl by Vitaly Valtman." -#define TG_DESCRIPTION "Telegram protocol." -#define TG_BUILD "12" - #include #include #include #include #include + +#define PLUGIN_ID "prpl-telegram" +#define TG_AUTHOR "Matthias Jentsch , Vitaly Valtman, Christopher Althaus , Markus Endres . Based on libtgl by Vitaly Valtman." +#define TG_DESCRIPTION "Telegram protocol." +#define TG_BUILD "13" #define TGP_APP_HASH "99428c722d0ed59b9cd844e4577cb4bb" #define TGP_APP_ID 16154 diff --git a/tgp-2prpl.c b/tgp-2prpl.c index 41a5e8f..fc2bab8 100644 --- a/tgp-2prpl.c +++ b/tgp-2prpl.c @@ -18,16 +18,13 @@ Copyright Matthias Jentsch 2014 */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "telegram-purple.h" #ifdef HAVE_LIBWEBP #include #include "lodepng/lodepng.h" #endif -#include "telegram-purple.h" #include "tgp-2prpl.h" #include "tgp-structs.h" #include "telegram-purple.h" diff --git a/tgp-msg.c b/tgp-msg.c index 4b26f2f..c185038 100644 --- a/tgp-msg.c +++ b/tgp-msg.c @@ -18,19 +18,15 @@ Copyright Matthias Jentsch 2014-2015 */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include "telegram-purple.h" #include #include #include #include #include - #include -#include "telegram-purple.h" #include "telegram-base.h" #include "tgp-structs.h" #include "tgp-msg.h" diff --git a/tgp-request.c b/tgp-request.c index 9f18e37..c45ebf7 100644 --- a/tgp-request.c +++ b/tgp-request.c @@ -18,18 +18,17 @@ Copyright Matthias Jentsch 2014-2015 */ +#include "telegram-purple.h" + #include #include #include #include #include -#define _(m) m - #include "msglog.h" #include "tgp-request.h" #include "telegram-base.h" -#include "telegram-purple.h" #include "tgp-2prpl.h" #include "tgp-utils.h"