Adds support for Telegram to Pidgin, Adium, Finch and other Libpurple based messengers.
Find a file
Christopher Althaus 58244abb2d changed login
2014-05-30 10:05:48 +02:00
debian initial commit 2014-02-03 21:31:23 +00:00
gentoo/telegram-cli telegram-cli gentoo ebuild pubkey fix 2014-03-16 13:44:44 +01:00
purple-plugin changed login 2014-05-30 10:05:48 +02:00
rpm Updated rpm with new spec 2014-02-05 16:14:07 +01:00
.gitignore Link header files of the telegram cli tool 2014-05-10 19:56:29 +02:00
.travis.yml Fixed travis.yml 2014-01-12 04:56:36 +04:00
ax_lua.m4 Update ax_lua.m4 2014-02-25 16:45:50 +01:00
binlog.c Use tree for peer_name search 2014-01-31 20:03:40 +04:00
binlog.h Added chat_with_peer command 2013-12-06 21:14:41 +04:00
binlog.tl Added files for binlog 2013-11-13 04:11:25 +04:00
config.h.in Added --with-progname="progname" option to configure. 2014-02-06 18:12:43 +04:00
config.sample fixed binlog problems. Set lock on binlog 2013-11-30 03:15:10 +04:00
configure Add /usr/local/include and /usr/local/lib to CPPFLAGS and LDFLAGS 2014-02-27 01:06:44 +01:00
configure.ac Add /usr/local/include and /usr/local/lib to CPPFLAGS and LDFLAGS 2014-02-27 01:06:44 +01:00
constants.h Merge github.com:vysheng/tg 2014-03-21 01:03:42 +04:00
gen_constants_h.awk Added full support for layer 10 2013-11-15 14:37:14 +04:00
include.h Added GPL-headers to source files 2013-10-23 18:26:17 +04:00
interface.c Add options for user verification, refactor header file-name to include functions into the purple-plugin and copy server.pub into the /etc/telegram directory when installing. 2014-05-11 22:18:21 +02:00
interface.h added support to sound notifications 2014-02-27 09:48:05 +01:00
LICENSE Added GPL license text 2013-10-23 18:53:22 +04:00
LICENSE.h Added some fixes required by GPL 2013-10-25 13:28:29 +04:00
loop.c Debugging changes 2014-05-23 13:42:05 +02:00
loop.h Use input values from account settings to authentication to data center 2014-05-23 11:36:54 +02:00
lua-tg.c lua: added postpone message 2014-02-06 22:09:43 +04:00
lua-tg.h Added partial lua support 2014-01-12 04:43:29 +04:00
main.c Debugging changes 2014-05-23 13:42:05 +02:00
Makefile.in Add options for user verification, refactor header file-name to include functions into the purple-plugin and copy server.pub into the /etc/telegram directory when installing. 2014-05-11 22:18:21 +02:00
mtproto-client.c Add options for user verification, refactor header file-name to include functions into the purple-plugin and copy server.pub into the /etc/telegram directory when installing. 2014-05-11 22:18:21 +02:00
mtproto-client.h do_rand () renamed to secure_random () 2013-12-25 04:44:36 +04:00
mtproto-common.c Merge branch 'master' of github.com:vysheng/tg 2014-01-27 19:10:41 +04:00
mtproto-common.h added layer 12 support 2014-03-20 19:33:08 +04:00
net.c Added cygwin fixes 2014-01-30 15:01:16 +04:00
net.h maybe fixed conn restart 2014-01-27 21:23:58 +04:00
no-preview.h Forgot GPL header. 2013-11-05 03:55:41 +04:00
queries.c fixed login 2014-03-21 15:33:06 +04:00
queries.h Added command create_group_chat <user> <chat topic>. 2014-02-25 21:13:14 +01:00
README.es use the right .pub file since commit #ff14a08d53ac9e223ffada8a41e69ebb673aa7d7 changed tg.pub to tg-server.pub 2014-03-21 16:34:06 +01:00
README.md changed login 2014-05-30 10:05:48 +02:00
structures.c fix to prev fix 2014-03-07 02:44:41 +04:00
structures.h structures.h: fixed foolish bug in structures defenition, leading to SIGSEGV 2014-03-17 00:45:10 +04:00
telegram-cli.spec use the right .pub file since commit #ff14a08d53ac9e223ffada8a41e69ebb673aa7d7 changed tg.pub to tg-server.pub 2014-03-21 16:34:06 +01:00
telegram.h Added /etc/telegram/server.pub as default server public key place 2014-02-04 20:35:16 +04:00
test.lua Added sample lua script 2014-01-12 04:43:56 +04:00
tg-cli.h Use input values from account settings to authentication to data center 2014-05-23 11:36:54 +02:00
tg-server.pub Enhance naming to show that the pubkey is the server's. 2014-03-11 15:10:19 +01:00
tools.c Added mark_read to lua functions 2014-01-28 16:40:35 +04:00
tools.h Added mark_read to lua functions 2014-01-28 16:40:35 +04:00
tree.h Added partial lua support 2014-01-12 04:43:29 +04:00

telegram-purple

Installieren

  1. Sicherstellen dass Pidgin installiert ist.

  2. Dieses Git-Repository klonen.

     git clone https://bitbucket.org/telegrampurple/telegram-purple
    
  3. Im Ordner von telegram-purple make ausführen:

     cd telgram-purple
     ./configure --disable-liblua --disable-libconfig
     make objects
     cd purple-plugin
     make install
    

Das Protokoll Telegram sollte dann beim nächsten Start in der Accountverwaltung von Pidgin automatisch auftauchen.

Testen und Debuggen

Um telegram-purple während der Entwicklung zu testen, ist es sinnvoll vorher die Berechtigungen des Plugin-Ordners zu ändern, damit beim Kopieren nicht jedes Mal Root-Rechte benötigt werden:

    sudo chmod 777 -R `pkg-config --variable=plugindir purple`
    sudo chmod 777 -R `pkg-config --variable=datarootdir purple`pixmaps/pidgin/protocol

Testen

Zum Compilen, Testen und Ausgeben aller Debugnachrichten folgenden Befehl ausführen:

    make run

Falls die Lognachrichten nach kurzer Zeit nicht mehr angezeigt werden, und die Meldung "Wird geschlossen, da bereits ein andere libpurple-Client läuft" erscheint, die laufende Instanz von Pidgin mit folgendem Befehl beenden:

    sudo killall pidgin

Filtern der Lognachrichten

Wenn Pidgin einfach mit make run ausgeführt wird, werden alle Debugnachrichten des gesamten Programms ausgegegeben. Libpurple verwendet interne Loggingfunktionen die den Lognachrichten automatisch einen Prefix hinzufügen, z.B. "plugins:" für Nachrichten des Pluginsloaders und "prpl-telegram:" für Nachrichten dieses Plugins.

Wenn man nur Ausgaben des Plugin-Loaders und von telegram-purple haben möchte kann man unnötige Nachrichten mit grep herausfiltern.

    make run | grep -i 'prpl-telegram:\|plugins:'

Deinstallieren

Mit folgendem Befehl werden alle installierten Dateien wieder aus den Plugin-Ordnern gelöscht:

    sudo make uninstall

Coding-Guidelines

Coding Style

Wir wollen wenn möglichen den typischen Linux-C-Coding-Style verwenden. Bei Funktionen werden die Klammern auf der nächsten Zeile geschrieben, bei allem anderen auf der gleichen Zeile. Bei Funktionsargumenten zwischen Komma und dem nächsten Argument und nach Bedingungen von if/else-Blöcken immer ein Leerzeichen lassen.

    unsigned int some_function(int a, int b)
    {
        if (true) {
            // ...
        } else {
            // ...
        }
    }

Logging

Wenn irgendeine Ausgabe gemacht wird, sollte das ausschließlich über die Libpurple Debugging-Funktionen passieren (Siehe die Anleitung zum Debuggen im Libpurple-Howto).

    #include "debug.h"
    #define PLUGIN_ID "prpl-telegram"

    // ...

     purple_debug_info(PLUGIN_ID, "Debugnachricht");

GIT

git pull -> Stand aktualisieren git add -A -> Files hinzufügen git push -> Stand hochladen git commit -> Commiten

Troubleshooting

Zum löschen der angelegten Accounts rm /home/USER/.purple/accounts.xml

Die lib muss eventuell nach /usr/lib/purple-2/telegram-purple.so kopiert werden