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

Commit

Permalink
Merge branch 'final'
Browse files Browse the repository at this point in the history
  • Loading branch information
majn committed Aug 29, 2015
2 parents ba868f7 + 31afb76 commit f10b683
Show file tree
Hide file tree
Showing 32 changed files with 1,110 additions and 479 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "tgl"]
path = tgl
url = https://github.com/vysheng/tgl
url = https://github.com/majn/tgl
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Changelog
---------

#### Version 1.2.0 (Beta 3)

##### Bugfixes

- Fix error in incoming message handling that caused segmentation faults
- Fix failing audio and video transfers
- Mark messages read on other devices as 'deferred' to avoid needless notifications
- Improved buddy list handling (should avoid "unknown" contacts popping up)
- Many small issues (see commit history)
- Fix issues that caused audio and video downloads to not have a proper file ending
- Fix issue that caused very old unused chats to not be available

###### Features

- Allow creation of new group chats
- Allow joining chats by invite link
- Allow exporting chats by invite link
- Support displaying and sending GIFs
- Support joining chats by invite link

##### Version 1.1.0 (Beta 2)

Expand Down
65 changes: 42 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
Telegram-Purple (Beta)
===============
Telegram-Purple Unofficial (Beta 3)
===================================

Telegram-purple is a Libpurple plugin that adds support for the Telegram messenger.

I keep getting many questions about this plugin in my mail, so I've created a telegram group
chat for [telegram group chat](https://telegram.me/joinchat/01fb53f301b67d3c7a5532908dfa9a89)
telegram-purple related discussions or questions.

Beta 2
Beta 3
------

- update to libtgl 2
- support two-factor authentication
- improve sticker support
- add option to control message read recipes
- many bugfixes
##### Bugfixes

- Fix error in incoming message handling that caused segmentation faults
- Fix failing audio and video transfers
- Improved buddy list handling (should avoid "unknown" contacts popping up)
- Many small issues (see commit history)
- Fix issues that caused audio and video downloads to not have a proper file ending
- Fix issue that caused very old unused chats to not be available

###### Features

- Support creation of new group chats
- Support joining chats by invite link
- Support exporting chats by invite link
- Support displaying and sending GIFs
- Mark messages read on other devices as 'deferred' to avoid needless notifications


This version should fix the crashes that seem to occur in many of the older version. Consider this another intermediate Beta version, there will be at least another one until I will consider it a release candidate.

If you migrate from an older version, the Telegram authentication files have been moved to .purple/telegram-purple. If you want to keep your old secret chats, please copy it manually from ~/.telegram-purple, otherwise you will be prompted for a new SMS code.

Expand Down Expand Up @@ -73,6 +89,14 @@ Usage

The username is your current phone number, including your full country prefix. For Germany, this would be '+49', resulting in a user name like '+49151123456'. Telegram will verify your phone number by sending you a code via sms. You will be prompted for this code, once that happens.

#### Buddy List

Like in the official Telegram apps, the displayed buddy list consists of all active conversations.

##### Foreign Users

Foreign users, like for example people you only know through a group chat but never had any conversation with, will not be part of your buddy list by default. You can add those users to the buddy list by clicking on "Add contact..." in the users context menu.

#### Using secret chats

You can use Telegram secret chats with this plugin, they will show up as a new buddy with a '!' in front of the buddy name.
Expand All @@ -89,7 +113,7 @@ Click on the buddy in the buddy list and click on "Show Info" to visualize the k

##### Initiate secret chats

To initiate a secret chat from Pidgin, click on a Buddy in the Buddy List and hit ``Start Secret Chat''
To initiate a secret chat from Pidgin, click on a Buddy in the Buddy List and hit "Start Secret Chat"

##### Deleting secret chats

Expand All @@ -102,20 +126,6 @@ The Telegram phone applications for iOS and Android make use of standardized Uni
does not display those smileys natively, but you can install a custom smiley theme like (https://github.com/stv0g/unicode-emoji) or (https://github.com/VxJasonxV/emoji-for-pidgin) and activate it under Settings > Themes > Smiley Theme.


Troubleshooting
---------------

If you encounter problems running this plugin and you have updated from an older version,
deleting your old user-data might be helpful. WARNING: This will require you to enter a new authentication
code and delete all your secret chat keys.

To clean all your user files run:


make purge



Building the Adium Plugin
-------------------------

Expand All @@ -131,6 +141,15 @@ Compiling with XCode is a little bit problematic, since it requries you to compi

5. Build the XCode-Project and execute the created bundle


Discussion / Help
-----------------

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

- https://telegram.me/joinchat/01fb53f301b67d3c7a5532908dfa9a89


Authors
-------

Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -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.1.0.
# Generated by GNU Autoconf 2.69 for telegram-purple 1.2.0.
#
#
# 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.1.0'
PACKAGE_STRING='telegram-purple 1.1.0'
PACKAGE_VERSION='1.2.0'
PACKAGE_STRING='telegram-purple 1.2.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1242,7 +1242,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.1.0 to adapt to many kinds of systems.
\`configure' configures telegram-purple 1.2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1303,7 +1303,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of telegram-purple 1.1.0:";;
short | recursive ) echo "Configuration of telegram-purple 1.2.0:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1406,7 +1406,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
telegram-purple configure 1.1.0
telegram-purple configure 1.2.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1825,7 +1825,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.1.0, which was
It was created by telegram-purple $as_me 1.2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -4902,7 +4902,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.1.0, which was
This file was extended by telegram-purple $as_me 1.2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4964,7 +4964,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.1.0
telegram-purple config.status 1.2.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

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

Expand Down
8 changes: 4 additions & 4 deletions rpm/purple-telegram.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Name: purple-telegram
Version: 1.0.1
Version: 1.2.0
Release: 1%{?dist}
Summary: Adds support for Telegram to Pidgin, Adium, Finch and other Libpurple based messengers
Summary: Adds support for Telegram to Pidgin, Adium, Finch and other Libpurple based messengers.
Group: Internet/Messaging
License: GPLv2+
URL: https://github.com/majn/telegram-purple
Source0: https://codeload.github.com/majn/telegram-purple/tar.gz/v%{version}.tar.gz

BuildRequires: openssl-devel,glib2-devel,libpurple-devel
Requires: openssl,glib2,libpurple
BuildRequires: openssl-devel,glib2-devel,libpurple-devel,libwebp-devel
Requires: openssl,glib2,libpurple,libwebp

%description

Expand Down
47 changes: 45 additions & 2 deletions telegram-adium/TelegramAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@
*/

#import "TelegramAccount.h"
#import "tgp-ft.h"

#import <libpurple/conversation.h>
#import <Adium/ESFileTransfer.h>
#import <Adium/AIListContact.h>
#import "tgp-ft.h"
#import <Adium/AIToolbarControllerProtocol.h>
#import <Adium/AIMenuControllerProtocol.h>
#import <Adium/AIChat.h>

#import <AIUtilities/AIToolbarUtilities.h>
#import <AIUtilities/AIImageAdditions.h>
#import <AIUtilities/AIMenuAdditions.h>


#include "telegram-purple.h"

Expand All @@ -46,7 +55,6 @@ - (int)port
return 443;
}


- (void)configurePurpleAccount
{
[super configurePurpleAccount];
Expand Down Expand Up @@ -87,6 +95,41 @@ - (void)configurePurpleAccount
intValue]);
}

#pragma mark Action Menu
-(NSMenu*)actionMenuForChat:(AIChat*)chat
{
NSArray *listObjects = nil;
AIListObject *listObject = nil;

if (listObjects.count) {
listObject = [listObjects objectAtIndex:0];
}

NSMenu *menu = [adium.menuController
contextualMenuWithLocations: [NSArray arrayWithObjects:
[NSNumber numberWithInteger: Context_GroupChat_Manage],
[NSNumber numberWithInteger: Context_Group_Manage],
[NSNumber numberWithInteger: Context_GroupChat_Action],
nil] forChat: chat];

[menu addItem:[NSMenuItem separatorItem]];

[menu addItemWithTitle:@"Invite users by link..."
target:self
action:@selector(addUserByLink)
keyEquivalent:@""
tag:0];
return menu;
}
- (void)addUserByLink
{
connection_data *conn = purple_connection_get_protocol_data (purple_account_get_connection(account));
AIChat *chat = adium.interfaceController.activeChat;
const char *subject = [[[chat chatCreationDictionary] objectForKey:@"subject"] UTF8String];
export_chat_link_checked (conn->TLS, subject);
}

#pragma mark File transfer
- (BOOL)canSendOfflineMessageToContact:(AIListContact *)inContact
{
return YES;
Expand Down
2 changes: 1 addition & 1 deletion telegram-adium/TelegramAccountView.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
Expand Down
2 changes: 1 addition & 1 deletion telegram-adium/TelegramAccountViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#import <Adium/AIService.h>
#import <AIUtilities/AIStringFormatter.h>
#import <AIUtilities/AIAttributedStringAdditions.h>
#import <AIUtilities/AIPopUpButtonAdditions.h>DISPLAY
#import <AIUtilities/AIPopUpButtonAdditions.h>

#include "telegram-purple.h"

Expand Down
28 changes: 28 additions & 0 deletions telegram-adium/TelegramAutocompletionDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
* Copyright Matthias Jentsch 2014-2015
*/

#import <Foundation/Foundation.h>

#include <tgl.h>

@interface TelegramAutocompletionDelegate : NSObject<NSTokenFieldDelegate> {
@private
struct tgl_state *TLS;
}
- (void)setTLS:(struct tgl_state *)TLS;
@end
Loading

0 comments on commit f10b683

Please sign in to comment.