Conversando no telegram pelo pidgin

pidgin_telegram

Sobre

Quase tão antigo quanto minha vivência com GNU/Linux, é minha preferência pelo pidgin. Um cliente simples, e repleto de recursos, para mensagens instantâneas. Muitas tecnologias de mensagens vieram, algumas já se foram, e a comunidade sempre deu um jeito de colocá-las no pidgin. Com o telegram não é diferente.

O projeto telegram-purple visa integrar o telegram à lib purple, que é o núcleo do pidgin e de outros mensageiros, tais como o adium e instantbird. Ele está em beta, mas demonstrou um bom comportamento durante minha utilização.

O ambiente

Debian 8.0 testing, amd-64. O pidigin foi instalado pelo repositório e está na versão 2.10.11 (libpurple 2.10.11)

Baixando as dependências

# apt-get install install libgcrypt20-dev libpurple-dev libwebp-dev gettext

Caso não tenha, instale os pacotes git e gcc.

Instalando

$ su
# cd /usr/src
# git clone --recursive https://github.com/majn/telegram-purple
# cd telegram-purple/
# ./configure
# make
# make install

A saída deverá ser parecida com esta:

19:30:26 root@lothlorien:/usr/src/telegram-purple$ ./configure 
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for clock_gettime in -lrt... yes
checking for gcry_mpi_snatch in -lgcrypt... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking if zlib is wanted... yes
checking for inflateEnd in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for PURPLE... yes
checking for libwebp... enabled
checking for WebPDecodeRGBA in -lwebp... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for size_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for memset... yes
checking for strdup... yes
checking for msgfmt... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
19:30:39 root@lothlorien:/usr/src/telegram-purple$ make
cd tgl && ./configure -q --disable-openssl --disable-extf CFLAGS="-g -O2" LDFLAGS=" -L/usr/lib -L/usr/lib"
make -C tgl
make[1]: Entering directory '/usr/src/telegram-purple/tgl'
cat scheme.tl encrypted_scheme.tl binlog.tl mtproto.tl append.tl > auto/scheme.tl
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tl-parser -c -MP -MD -MF dep/tl-parser.d -MQ objs/tl-parser.o -o objs/tl-parser.o tl-parser/tl-parser.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tl-parser -c -MP -MD -MF dep/tlc.d -MQ objs/tlc.o -o objs/tlc.o tl-parser/tlc.c
gcc objs/tl-parser.o objs/tlc.o -L/usr/lib -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/lib  -rdynamic -ggdb -lz -lgcrypt    -o bin/tl-parser
bin/tl-parser -E auto/scheme.tl 2> auto/scheme2.tl  || ( cat auto/scheme2.tl && rm auto/scheme2.tl && false )
awk -f ./gen_constants_h.awk < auto/scheme2.tl > auto/constants.h
bin/tl-parser -e auto/scheme.tlo auto/scheme.tl
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/generate.d -MQ objs/generate.o -o objs/generate.o generate.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/tools.d -MQ objs/tools.o -o objs/tools.o tools.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/rand_openssl.d -MQ objs/crypto/rand_openssl.o -o objs/crypto/rand_openssl.o crypto/rand_openssl.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/rand_altern.d -MQ objs/crypto/rand_altern.o -o objs/crypto/rand_altern.o crypto/rand_altern.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/err_openssl.d -MQ objs/crypto/err_openssl.o -o objs/crypto/err_openssl.o crypto/err_openssl.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/err_altern.d -MQ objs/crypto/err_altern.o -o objs/crypto/err_altern.o crypto/err_altern.c
gcc objs/generate.o objs/tools.o objs/crypto/rand_openssl.o objs/crypto/rand_altern.o objs/crypto/err_openssl.o objs/crypto/err_altern.o -L/usr/lib -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/lib  -rdynamic -ggdb -lz -lgcrypt    -o bin/generate
bin/generate -g skip-header auto/scheme.tlo > auto/auto-skip.h || ( rm auto/auto-skip.h && false )
bin/generate -g fetch-header auto/scheme.tlo > auto/auto-fetch.h || ( rm auto/auto-fetch.h && false )
bin/generate -g store-header auto/scheme.tlo > auto/auto-store.h || ( rm auto/auto-store.h && false )
bin/generate -g autocomplete-header auto/scheme.tlo > auto/auto-autocomplete.h || ( rm auto/auto-autocomplete.h && false )
bin/generate -g types-header auto/scheme.tlo > auto/auto-types.h || ( rm auto/auto-types.h && false )
bin/generate -g fetch-ds-header auto/scheme.tlo > auto/auto-fetch-ds.h || ( rm auto/auto-fetch-ds.h && false )
bin/generate -g free-ds-header auto/scheme.tlo > auto/auto-free-ds.h || ( rm auto/auto-free-ds.h && false )
bin/generate -g store-ds-header auto/scheme.tlo > auto/auto-store-ds.h || ( rm auto/auto-store-ds.h && false )
bin/generate -g print-ds-header auto/scheme.tlo > auto/auto-print-ds.h || ( rm auto/auto-print-ds.h && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/mtproto-common.d -MQ objs/mtproto-common.o -o objs/mtproto-common.o mtproto-common.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/mtproto-client.d -MQ objs/mtproto-client.o -o objs/mtproto-client.o mtproto-client.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/mtproto-key.d -MQ objs/mtproto-key.o -o objs/mtproto-key.o mtproto-key.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/queries.d -MQ objs/queries.o -o objs/queries.o queries.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/structures.d -MQ objs/structures.o -o objs/structures.o structures.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/binlog.d -MQ objs/binlog.o -o objs/binlog.o binlog.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/tgl.d -MQ objs/tgl.o -o objs/tgl.o tgl.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/updates.d -MQ objs/updates.o -o objs/updates.o updates.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/tg-mime-types.d -MQ objs/tg-mime-types.o -o objs/tg-mime-types.o tg-mime-types.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/mtproto-utils.d -MQ objs/mtproto-utils.o -o objs/mtproto-utils.o mtproto-utils.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/bn_openssl.d -MQ objs/crypto/bn_openssl.o -o objs/crypto/bn_openssl.o crypto/bn_openssl.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/bn_altern.d -MQ objs/crypto/bn_altern.o -o objs/crypto/bn_altern.o crypto/bn_altern.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/rsa_pem_openssl.d -MQ objs/crypto/rsa_pem_openssl.o -o objs/crypto/rsa_pem_openssl.o crypto/rsa_pem_openssl.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/rsa_pem_altern.d -MQ objs/crypto/rsa_pem_altern.o -o objs/crypto/rsa_pem_altern.o crypto/rsa_pem_altern.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/md5_openssl.d -MQ objs/crypto/md5_openssl.o -o objs/crypto/md5_openssl.o crypto/md5_openssl.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/md5_altern.d -MQ objs/crypto/md5_altern.o -o objs/crypto/md5_altern.o crypto/md5_altern.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/sha_openssl.d -MQ objs/crypto/sha_openssl.o -o objs/crypto/sha_openssl.o crypto/sha_openssl.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/sha_altern.d -MQ objs/crypto/sha_altern.o -o objs/crypto/sha_altern.o crypto/sha_altern.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/aes_openssl.d -MQ objs/crypto/aes_openssl.o -o objs/crypto/aes_openssl.o crypto/aes_openssl.c
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -c -MP -MD -MF dep/crypto/aes_altern.d -MQ objs/crypto/aes_altern.o -o objs/crypto/aes_altern.o crypto/aes_altern.c
bin/generate -g skip auto/scheme.tlo > auto/auto-skip.c || ( rm auto/auto-skip.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-skip.d -MQ objs/auto-skip.o -o objs/auto/auto-skip.o auto/auto-skip.c
bin/generate -g fetch auto/scheme.tlo > auto/auto-fetch.c || ( rm auto/auto-fetch.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-fetch.d -MQ objs/auto-fetch.o -o objs/auto/auto-fetch.o auto/auto-fetch.c
bin/generate -g store auto/scheme.tlo > auto/auto-store.c || ( rm auto/auto-store.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-store.d -MQ objs/auto-store.o -o objs/auto/auto-store.o auto/auto-store.c
bin/generate -g autocomplete auto/scheme.tlo > auto/auto-autocomplete.c || ( rm auto/auto-autocomplete.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-autocomplete.d -MQ objs/auto-autocomplete.o -o objs/auto/auto-autocomplete.o auto/auto-autocomplete.c
bin/generate -g types auto/scheme.tlo > auto/auto-types.c || ( rm auto/auto-types.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-types.d -MQ objs/auto-types.o -o objs/auto/auto-types.o auto/auto-types.c
bin/generate -g fetch-ds auto/scheme.tlo > auto/auto-fetch-ds.c || ( rm auto/auto-fetch-ds.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-fetch-ds.d -MQ objs/auto-fetch-ds.o -o objs/auto/auto-fetch-ds.o auto/auto-fetch-ds.c
bin/generate -g free-ds auto/scheme.tlo > auto/auto-free-ds.c || ( rm auto/auto-free-ds.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-free-ds.d -MQ objs/auto-free-ds.o -o objs/auto/auto-free-ds.o auto/auto-free-ds.c
bin/generate -g store-ds auto/scheme.tlo > auto/auto-store-ds.c || ( rm auto/auto-store-ds.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-store-ds.d -MQ objs/auto-store-ds.o -o objs/auto/auto-store-ds.o auto/auto-store-ds.c
bin/generate -g print-ds auto/scheme.tlo > auto/auto-print-ds.c || ( rm auto/auto-print-ds.c && false )
gcc -I. -I. -g -O2  -I/usr/local/include -I/usr/include -I/usr/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/auto-print-ds.d -MQ objs/auto-print-ds.o -o objs/auto/auto-print-ds.o auto/auto-print-ds.c
rm -f libs/libtgl.a && ar ruv libs/libtgl.a objs/mtproto-common.o objs/mtproto-client.o objs/mtproto-key.o objs/queries.o objs/structures.o objs/binlog.o objs/tgl.o objs/updates.o objs/tg-mime-types.o objs/mtproto-utils.o objs/crypto/bn_openssl.o objs/crypto/bn_altern.o objs/crypto/rsa_pem_openssl.o objs/crypto/rsa_pem_altern.o objs/crypto/md5_openssl.o objs/crypto/md5_altern.o objs/crypto/sha_openssl.o objs/crypto/sha_altern.o objs/crypto/aes_openssl.o objs/crypto/aes_altern.o objs/tools.o objs/crypto/rand_openssl.o objs/crypto/rand_altern.o objs/crypto/err_openssl.o objs/crypto/err_altern.o objs/auto/auto-skip.o objs/auto/auto-fetch.o objs/auto/auto-store.o objs/auto/auto-autocomplete.o objs/auto/auto-types.o objs/auto/auto-fetch-ds.o objs/auto/auto-free-ds.o objs/auto/auto-store-ds.o objs/auto/auto-print-ds.o
ar: `u' modifier ignored since `D' is the default (see `U')
ar: creating libs/libtgl.a
a - objs/mtproto-common.o
a - objs/mtproto-client.o
a - objs/mtproto-key.o
a - objs/queries.o
a - objs/structures.o
a - objs/binlog.o
a - objs/tgl.o
a - objs/updates.o
a - objs/tg-mime-types.o
a - objs/mtproto-utils.o
a - objs/crypto/bn_openssl.o
a - objs/crypto/bn_altern.o
a - objs/crypto/rsa_pem_openssl.o
a - objs/crypto/rsa_pem_altern.o
a - objs/crypto/md5_openssl.o
a - objs/crypto/md5_altern.o
a - objs/crypto/sha_openssl.o
a - objs/crypto/sha_altern.o
a - objs/crypto/aes_openssl.o
a - objs/crypto/aes_altern.o
a - objs/tools.o
a - objs/crypto/rand_openssl.o
a - objs/crypto/rand_altern.o
a - objs/crypto/err_openssl.o
a - objs/crypto/err_altern.o
a - objs/auto/auto-skip.o
a - objs/auto/auto-fetch.o
a - objs/auto/auto-store.o
a - objs/auto/auto-autocomplete.o
a - objs/auto/auto-types.o
a - objs/auto/auto-fetch-ds.o
a - objs/auto/auto-free-ds.o
a - objs/auto/auto-store-ds.o
a - objs/auto/auto-print-ds.o
gcc -shared -o libs/libtgl.so objs/mtproto-common.o objs/mtproto-client.o objs/mtproto-key.o objs/queries.o objs/structures.o objs/binlog.o objs/tgl.o objs/updates.o objs/tg-mime-types.o objs/mtproto-utils.o objs/crypto/bn_openssl.o objs/crypto/bn_altern.o objs/crypto/rsa_pem_openssl.o objs/crypto/rsa_pem_altern.o objs/crypto/md5_openssl.o objs/crypto/md5_altern.o objs/crypto/sha_openssl.o objs/crypto/sha_altern.o objs/crypto/aes_openssl.o objs/crypto/aes_altern.o objs/tools.o objs/crypto/rand_openssl.o objs/crypto/rand_altern.o objs/crypto/err_openssl.o objs/crypto/err_altern.o objs/auto/auto-skip.o objs/auto/auto-fetch.o objs/auto/auto-store.o objs/auto/auto-autocomplete.o objs/auto/auto-types.o objs/auto/auto-fetch-ds.o objs/auto/auto-free-ds.o objs/auto/auto-store-ds.o objs/auto/auto-print-ds.o -L/usr/lib -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/lib  -rdynamic -ggdb -lz -lgcrypt   
make[1]: Leaving directory '/usr/src/telegram-purple/tgl'
cp tgl/libs/libtgl.a libs/libtgl.a
echo objs/tgp-net.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-net.d -MQ objs/tgp-net.o -o objs/tgp-net.o tgp-net.c
objs/tgp-net.o
echo objs/tgp-timers.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-timers.d -MQ objs/tgp-timers.o -o objs/tgp-timers.o tgp-timers.c
objs/tgp-timers.o
echo objs/msglog.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/msglog.d -MQ objs/msglog.o -o objs/msglog.o msglog.c
objs/msglog.o
echo objs/telegram-base.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/telegram-base.d -MQ objs/telegram-base.o -o objs/telegram-base.o telegram-base.c
objs/telegram-base.o
echo objs/telegram-purple.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/telegram-purple.d -MQ objs/telegram-purple.o -o objs/telegram-purple.o telegram-purple.c
objs/telegram-purple.o
echo objs/tgp-2prpl.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-2prpl.d -MQ objs/tgp-2prpl.o -o objs/tgp-2prpl.o tgp-2prpl.c
objs/tgp-2prpl.o
echo objs/tgp-structs.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-structs.d -MQ objs/tgp-structs.o -o objs/tgp-structs.o tgp-structs.c
objs/tgp-structs.o
echo objs/tgp-utils.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-utils.d -MQ objs/tgp-utils.o -o objs/tgp-utils.o tgp-utils.c
objs/tgp-utils.o
echo objs/tgp-chat.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-chat.d -MQ objs/tgp-chat.o -o objs/tgp-chat.o tgp-chat.c
objs/tgp-chat.o
echo objs/tgp-ft.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-ft.d -MQ objs/tgp-ft.o -o objs/tgp-ft.o tgp-ft.c
objs/tgp-ft.o
echo objs/tgp-msg.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-msg.d -MQ objs/tgp-msg.o -o objs/tgp-msg.o tgp-msg.c
objs/tgp-msg.o
echo objs/tgp-request.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-request.d -MQ objs/tgp-request.o -o objs/tgp-request.o tgp-request.c
objs/tgp-request.o
echo objs/tgp-blist.o && gcc -g -O2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpurple -DHAVE_CONFIG_H -DENABLE_NLS -DLOCALEDIR='"/usr/local/share/locale"' -Wall -Wextra -Wno-deprecated-declarations -Wno-unused-parameter -I. -I. -fno-strict-aliasing -fPIC  -I ./tgl -c -MP -MD -MF dep/tgp-blist.d -MQ objs/tgp-blist.o -o objs/tgp-blist.o tgp-blist.c
objs/tgp-blist.o
gcc -shared -o bin/telegram-purple.so objs/tgp-net.o objs/tgp-timers.o objs/msglog.o objs/telegram-base.o objs/telegram-purple.o objs/tgp-2prpl.o objs/tgp-structs.o objs/tgp-utils.o objs/tgp-chat.o objs/tgp-ft.o objs/tgp-msg.o objs/tgp-request.o objs/tgp-blist.o libs/libtgl.a -L/usr/lib -L/usr/lib  -lpurple -lglib-2.0 -lwebp -lz -lgcrypt -lrt  -rdynamic -ggdb
/usr/bin/msgfmt -cf -o po/de_DE.mo po/de_DE.po
/usr/bin/msgfmt -cf -o po/es_AR.mo po/es_AR.po
/usr/bin/msgfmt -cf -o po/pl_PL.mo po/pl_PL.po
/usr/bin/msgfmt -cf -o po/pt_BR.mo po/pt_BR.po
/usr/bin/msgfmt -cf -o po/ru_RU.mo po/ru_RU.po
/usr/bin/msgfmt -cf -o po/sq.mo po/sq.po
/usr/bin/msgfmt -cf -o po/uk.mo po/uk.po
19:53:57 root@lothlorien:/usr/src/telegram-purple$ make install
mkdir -m 0755 -p /usr/lib/purple-2
install -m 0644 bin/telegram-purple.so /usr/lib/purple-2/telegram-purple.so
mkdir -m 0755 -p /etc/telegram-purple
install -m 0644 tg-server.tglpub /etc/telegram-purple/server.tglpub
mkdir -m 0755 -p /usr/local/share/appdata
install -m 0644 telegram-purple.metainfo.xml /usr/local/share/appdata/telegram-purple.metainfo.xml
mkdir -m 0755 -p /usr/share/pixmaps/pidgin/protocols/16
install -m 0644 imgs/telegram16.png /usr/share/pixmaps/pidgin/protocols/16/telegram.png
mkdir -m 0755 -p /usr/share/pixmaps/pidgin/protocols/22
install -m 0644 imgs/telegram22.png /usr/share/pixmaps/pidgin/protocols/22/telegram.png
mkdir -m 0755 -p /usr/share/pixmaps/pidgin/protocols/48
install -m 0644 imgs/telegram48.png /usr/share/pixmaps/pidgin/protocols/48/telegram.png
installing po/de_DE.mo to /usr/local/share/locale/de_DE/LC_MESSAGES/telegram-purple.mo
installing po/es_AR.mo to /usr/local/share/locale/es_AR/LC_MESSAGES/telegram-purple.mo
installing po/pl_PL.mo to /usr/local/share/locale/pl_PL/LC_MESSAGES/telegram-purple.mo
installing po/pt_BR.mo to /usr/local/share/locale/pt_BR/LC_MESSAGES/telegram-purple.mo
installing po/ru_RU.mo to /usr/local/share/locale/ru_RU/LC_MESSAGES/telegram-purple.mo
installing po/sq.mo to /usr/local/share/locale/sq/LC_MESSAGES/telegram-purple.mo
installing po/uk.mo to /usr/local/share/locale/uk/LC_MESSAGES/telegram-purple.mo

 

Configurando

Abra, ou reinicie, o pidgin e vá em Contas -> Gerenciar contas -> Adicionar. Em protocolo, selecione Telegram, conforme a imagem:

Selecinando protocolo Telegram no pidgin

O nome de usuário é composto pelo prefixo do país, 55 no caso do Brasil, mais o código de área e o seu número. Os demais campos não são obrigatórios.

Preenchendo número do telefone vinculado ao Telegram do Pidgin

Na aba avançado é possível alterar algumas opções interessantes. Mas cuidado, você pode ser inundado com uma avalanche (hãm?!) de mensagens. No meu caso ficou assim:

Configura as opções do telegram no pidgin

Como eu gosto de armazenar os históricos, marquei para obter todos eles assim que for feito o primeiro login. Essa opção deixou o pidgin ocupado durante um intervalo considerável de tempo.

Também há a opção para mostrar os grupos do telegram na janela de contatos do pidgin.

Após clicar em adicionar, na janela de adicionar conta, é exibida uma pequena janela solicitando o código de confirmação que foi enviado, por SMS, ao número definido no campo nome de usuário. No meu caso, que estava sem o chip em questão, fechei essa janela, desativando a conta no pidgin, depois ativei a conta e o código de confirmação foi enviado pelo aplicativo do telegram instalado no meu smartphone.

Os teus contatos que tiverem conta no telegram aparecerão no grupo Telegram. Já os bate-papos em grupo aparecerão no grupo Telegram Chats.

Conversas secretas

O plugin suporta chats secretos. Para iniciar um, vá até a lista de amigos e clique com o botão direito em um deles. Dentre as opções que aparecem, escolha Começar conversa secreta. O contato irá aparecer novamente na lista, porém o nome dele começará com uma “!”. Agora basta dar dois cliques e o chat começará. Ao excluir esse amigo da lista, a conversa termina e não poderá ser reutilizada, sendo necessário reiniciar o processo.

Por uma definição do protocolo do telegram, uma conversa secreta pode ter apenas um destino final, isto é, não é possível usar a mesma conversa em dois lugares; no pidgin e no celular, por exemplo. Nas opções avançadas (que mostrei mais acima) é possível definir o comportamento padrão para conversas secretas. Definindo o campo Aceitar conversa secreta para pergunta faz com que a cada nova conversa secreta você seja perguntando se quer iniciá-la no pidgin.

Atualmente a conversa secreta com autodestruição não é suportada, fazendo com que, ao aceitar iniciar a conversa, o pidgin retorne erro a cada tentativa de enviar uma mensagem. Isto deve-se ao fato dos desenvolvedores da biblioteca não terem encontrado um meio de fazer a exclusão do texto na tela e no histórico ?através da api do pidgin?. O lado positivo é que, mesmo iniciando a conversa pelo pidgin, ela passa a estar disponível no telegram no smartphone.

Nota: na versão beta 1 1.2.6, utilizada no momento em que escrevo este texto, o envio de imagens em uma conversa secreta não está funcionando.

Smileys

O aplicativo do telegram para Android e iOS utilizam smiles padronizados em unicode, chamados emojis. Nativamente o pidgin não suporta emojis, mas há projetos(disponíveis aqui e aqui) que resolvem este problema. Para instalá-los faça:

$ cd ~/.purple/smileys/
$ git clone https://github.com/stv0g/unicode-emoji.git
$ git clone https://github.com/VxJasonxV/emoji-for-pidgin.git
$ ln -s unicode-emoji/apple apple
$ ln -s unicode-emoji/android android
$ ln -s unicode-emoji/symbola symbola
$ ln -s emoji-for-pidgin/Emoji-for-Pidgin emoji_for_pidgin

No pidgin, vá em Ferramentas -> Preferências -> Temas. Em Temas de emoticons estão os temas recém instalados. IMHO, o mais interessante (por ter funcionado conforme o esperado e conter uma boa gama de emojis) é Apple Emoji Theme, de Steffen Vogel. Tenha em mente que este pacote de emoticons será o padrão em todas as conversas, independentemente do protocolo.

Referências

Grande parte do que fui dito aqui é resultado da leitura do readme do projeto telegram-purple e de testes que fiz com o auxílio do João Fernando, responsável pela revista @espiritolivre, e do Mikael Hadler.

Histórico

  • 03/05/2015 – Artigo publicado baseando-se na versão beta 1
  • 10/05/16 – Atualizado para a versão 1.2.6 da biblioteca