Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into dev-1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
majn committed Jan 24, 2016
2 parents 6eee0c3 + df29bbc commit ac1c748
Show file tree
Hide file tree
Showing 11 changed files with 139 additions and 65 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,37 @@
Changelog
---------

##### 1.2.5

- Include libtgl fix to prevent crashes on certain channel messages
- Improve error handling to be more graceful

##### 1.2.4

- Fix crash on unknown media type
- Fix crash on logout after cancelling a file transfer

##### 1.2.3

- Build: Allow compilation on Windows #52 Thanks Eion!
- Build: Drop dependency on LodePNG, Thanks Ben!
- Build: Gettext is now optional

- Fix issue that prevented to send messages to deleted users in certain cases (#174)
- Fix own user being added to the buddy list in certain cases
- Fix that read recipes of own messages are being displayed (#139)
- Fix encoding inconsistencies with Unicode characters (#177)
- Fix auto-joining for chats (#179)
- Fix client not reconnecting anymore under certain circumstances (#173)
- Fix crash on compat-verification (PullRequest #183)

- Remove pointless "create chat" confirmation dialogue
- Improve logging messages
- Always send read recipes when the user is typing or sending a message
- Improve translation and user messages (#139)
- Use native password prompts (Adium)


##### 1.2.2

- fix some licensing issues by not depending on OpenSSL any longer (thanks Ben!)
Expand Down
34 changes: 7 additions & 27 deletions README.md
Expand Up @@ -4,7 +4,7 @@ Telegram-Purple Unofficial (Beta)
Telegram-purple is a Libpurple protocol plugin that adds support for the Telegram messenger.

I keep getting many questions about this plugin in my E-mail, so I've created a
[telegram group chat](https://goo.gl/bhmM7N) for
[telegram group chat](https://goo.gl/a8SigQ) for
telegram-purple related discussions or questions.

Installation
Expand All @@ -17,7 +17,7 @@ If your platform is not supported or you want to contribute by testing or develo

#### OSX (Adium)

1. Download and execute the [Telegram-Adium bundle] (https://github.com/majn/telegram-purple/releases/download/v1.2.4/telegram-adium-1.2.4.AdiumLibpurplePlugin.zip)
1. Download and execute the [Telegram-Adium bundle] (https://github.com/majn/telegram-purple/releases/download/v1.2.5/telegram-adium-1.2.5.AdiumLibpurplePlugin.zip)
2. Restart Adium

#### Windows
Expand Down Expand Up @@ -217,32 +217,12 @@ and `.dsc` files, do this:

Note that the parenthesis are important.

1.2.4
1.2.5
-----

- Fix crash on unknown media type
- Fix crash on logout after cancelling a file transfer

1.2.3
-----

- Build: Allow compilation on Windows #52 Thanks Eion!
- Build: Drop dependency on LodePNG, Thanks Ben!
- Build: Gettext is now optional

- Fix issue that prevented to send messages to deleted users in certain cases (#174)
- Fix own user being added to the buddy list in certain cases
- Fix that read recipes of own messages are being displayed (#139)
- Fix encoding inconsistencies with Unicode characters (#177)
- Fix auto-joining for chats (#179)
- Fix client not reconnecting anymore under certain circumstances (#173)
- Fix crash on compat-verification (PullRequest #183)

- Remove pointless "create chat" confirmation dialogue
- Improve logging messages
- Always send read recipes when the user is typing or sending a message
- Improve translation and user messages (#139)
- Use native password prompts (Adium)
- Handle revoked sessions automatically
- Include libtgl fix to prevent crashes on certain channel messages
- Improve error handling


Discussion / Help
Expand Down Expand Up @@ -273,7 +253,7 @@ FAQ

Telegram group chat for telegram-purple or libtgl related discussions or questions:

- https://goo.gl/bhmM7N
- https://goo.gl/a8SigQ


Submitting Bug Reports
Expand Down
18 changes: 9 additions & 9 deletions configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for telegram-purple 1.2.4.
# Generated by GNU Autoconf 2.69 for telegram-purple 1.2.5.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='telegram-purple'
PACKAGE_TARNAME='telegram-purple'
PACKAGE_VERSION='1.2.4'
PACKAGE_STRING='telegram-purple 1.2.4'
PACKAGE_VERSION='1.2.5'
PACKAGE_STRING='telegram-purple 1.2.5'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1249,7 +1249,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures telegram-purple 1.2.4 to adapt to many kinds of systems.
\`configure' configures telegram-purple 1.2.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1310,7 +1310,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of telegram-purple 1.2.4:";;
short | recursive ) echo "Configuration of telegram-purple 1.2.5:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1418,7 +1418,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
telegram-purple configure 1.2.4
telegram-purple configure 1.2.5
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1837,7 +1837,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by telegram-purple $as_me 1.2.4, which was
It was created by telegram-purple $as_me 1.2.5, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -5098,7 +5098,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by telegram-purple $as_me 1.2.4, which was
This file was extended by telegram-purple $as_me 1.2.5, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -5160,7 +5160,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
telegram-purple config.status 1.2.4
telegram-purple config.status 1.2.5
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -20,7 +20,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([telegram-purple], [1.2.4])
AC_INIT([telegram-purple], [1.2.5])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])

Expand Down
11 changes: 10 additions & 1 deletion rpm/purple-telegram.spec
Expand Up @@ -39,9 +39,18 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/telegram-
%{_datadir}/pixmaps/pidgin/protocols/48/telegram.png

%changelog
* Thu Dec 10 2015 tuxmaster 1.3.0
* Thu Dec 10 2015 tuxmaster 1.3.0-1
- Build for 1.3.0

* Sat Jan 23 mjentsch 1.2.5-1
- build for 1.2.5

* Thu Dec 10 2015 tuxmaster 1.2.4-2
- Fix build for appdata.

* Thu Dec 10 2015 mjentsch 1.2.4-1
- build for 1.2.4

* Thu Dec 10 2015 tuxmaster 1.2.4-2
- Fix build for appdata.

Expand Down
4 changes: 2 additions & 2 deletions telegram-adium/telegram-adium/telegram-adium-Info.plist
Expand Up @@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.4</string>
<string>1.2.5</string>
<key>CFBundleSignature</key>
<string>AdIM</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>1.2.5</string>
<key>CFPlugInDynamicRegisterFunction</key>
<string></string>
<key>CFPlugInDynamicRegistration</key>
Expand Down
24 changes: 22 additions & 2 deletions telegram-purple.c
Expand Up @@ -35,6 +35,7 @@ static void update_user_handler (struct tgl_state *TLS, struct tgl_user *U, unsi
static void update_secret_chat_handler (struct tgl_state *TLS, struct tgl_secret_chat *C, unsigned flags);
static void update_chat_handler (struct tgl_state *TLS, struct tgl_chat *C, unsigned flags);
static void update_channel_handler (struct tgl_state *TLS, struct tgl_channel *C, unsigned flags);
static void update_on_failed_login (struct tgl_state *TLS);

const char *config_dir = "telegram-purple";
const char *user_pk_filename = "server.tglpub";
Expand All @@ -59,8 +60,8 @@ struct tgl_update_callback tgp_callback = {
.secret_chat_update = update_secret_chat_handler,
.msg_receive = update_message_handler,
.user_status_update = update_user_status_handler,
.create_print_name = tgp_blist_create_print_name
// FIXME: on_failed_login ?
.create_print_name = tgp_blist_create_print_name,
.on_failed_login = update_on_failed_login
};

static void _update_buddy (struct tgl_state *TLS, tgl_peer_t *user, unsigned flags) {
Expand Down Expand Up @@ -528,6 +529,18 @@ static void update_on_ready (struct tgl_state *TLS) {
tgl_do_update_contact_list (TLS, 0, 0);
}

static void update_on_failed_login (struct tgl_state *TLS) {
info ("update_on_failed_login(): Login to telegram failed.");

// 401: SESSION_REVOKED is called when the session is cancelled during runtime
// 401: AUTH_KEY_UNREGISTERED is called when logging into a revoked session
if (strstr (TLS->error, "SESSION_REVOKED") ||
strstr (TLS->error, "AUTH_KEY_UNREGISTERED")) {
purple_account_set_bool (tls_get_pa (TLS), TGP_KEY_RESET_AUTH, TRUE);
}
purple_connection_error (tls_get_conn (TLS), TLS->error);
}

static void tgprpl_login (PurpleAccount * acct) {
info ("tgprpl_login(): Purple is telling the prpl to connect the account");

Expand Down Expand Up @@ -587,6 +600,7 @@ static void tgprpl_login (PurpleAccount * acct) {
tgl_set_timer_methods (TLS, &tgp_timers);
tgl_set_callback (TLS, &tgp_callback);
tgl_register_app_id (TLS, TGP_APP_ID, TGP_APP_HASH);
tgl_set_app_version (TLS, PACKAGE_VERSION);
tgl_init (TLS);

if (! tgp_startswith (purple_account_get_username (acct), "+")) {
Expand All @@ -604,6 +618,12 @@ static void tgprpl_login (PurpleAccount * acct) {
read_auth_file (TLS);
read_state_file (TLS);

if (purple_account_get_bool (acct, TGP_KEY_RESET_AUTH, FALSE)) {
info ("last login attempt failed, resetting authorization ...");
purple_account_set_bool (tls_get_pa (TLS), TGP_KEY_RESET_AUTH, FALSE);
bl_do_reset_authorization (TLS);
}

purple_connection_set_state (conn->gc, PURPLE_CONNECTING);
tgl_login (TLS);
}
Expand Down
2 changes: 2 additions & 0 deletions telegram-purple.h
Expand Up @@ -87,6 +87,8 @@
#define TGP_DEFAULT_SEND_READ_NOTIFICATIONS TRUE
#define TGP_KEY_SEND_READ_NOTIFICATIONS "send-read-notifications"

#define TGP_KEY_RESET_AUTH "reset-authorization"

extern const char *pk_path;
extern const char *user_pk_filename;
extern const char *config_dir;
Expand Down

0 comments on commit ac1c748

Please sign in to comment.