Commit graph

103 commits

Author SHA1 Message Date
mjentsch
91ac1b06ee Remove old printfs of telegram-cli to fix issues on Finch 2014-10-14 22:06:29 +02:00
mjentsch
d5fb1601b7 cleanup useless comments 2014-10-14 18:53:59 +02:00
mjentsch
61c8735578 Force-free all open connections on close 2014-10-10 17:26:31 +02:00
mjentsch
2f7f2068de Improve event handling-system 2014-10-06 22:57:20 +02:00
mjentsch
8eacac2b87 Load public key from Adium bundle 2014-10-05 14:19:05 +02:00
mjentsch
4b7b1e0010 Fix includes and remove obsolete code 2014-10-05 12:25:23 +02:00
mjentsch
f16f32d8c4 Rename struct user to struct tgl_user to avoid namespace collisions with osx system headers 2014-10-04 20:36:54 +02:00
mjentsch
334101c406 Improve logging system 2014-10-03 14:23:15 +02:00
mjentsch
7c69af9b00 Remove unused code 2014-10-02 12:46:19 +02:00
mjentsch
5c488f9c8d Support downloads from foreign DCs 2014-10-02 12:29:02 +02:00
mjentsch
7fa1600e0b Add log output for received message types 2014-09-20 10:04:40 +02:00
mjentsch
bb87200d5f Fix a bug that caused old messages to not be loaded on startup
Do not overwrite state file with secret chat file, provide flag for complete sync from start in do_get_difference
2014-09-18 22:26:08 +02:00
mjentsch
4a062b764f Use a separate handles for each mtproto_connection 2014-09-17 22:51:46 +02:00
mjentsch
00944910bc Remove pinging 2014-09-08 23:09:55 +02:00
mjentsch
7d8ec1ef42 Add missing message allocated handlers 2014-09-08 23:09:20 +02:00
mjentsch
f0447fa958 Free all pending timers and queries after erroring 2014-09-06 01:09:47 +02:00
mjentsch
b90c9453da Free memory and close connections on disconnect 2014-09-01 21:57:35 +02:00
mjentsch
d94dc52df0 Remove remaining global variables 2014-09-01 21:43:22 +02:00
Christopher Althaus
fa9d45bd20 User State/Typing implemented
Send Messages activated
2014-08-23 16:23:37 +02:00
mjentsch
5a425be62f Remove unused code and build files 2014-08-23 12:57:38 +02:00
mjentsch
a4e5449d5a Move telegram callbacks and settings into configuration struct 2014-08-23 02:40:10 +02:00
mjentsch
c81ce16e80 Fix coding style and add missing docstrings 2014-08-22 18:57:14 +02:00
mjentsch
8ff9734077 Handle the SWITCH_DC RPCError by changing the data center and creating a new mtproto_connection 2014-08-22 18:54:25 +02:00
mjentsch
5d8d170927 Use allocation utilities from utilites.h and initiate telegram with zeroes 2014-08-22 18:44:23 +02:00
mjentsch
c144484fd5 Add memory management for mtproto_connections
Mark connections for destruction on close and free all allocated memory only once all incoming queries are read, since those queries will still access data on the current mtproto_connection and cause segmentation faults.
2014-08-22 18:41:35 +02:00
mjentsch
54091b26e3 Log all output of verbosity-level 1 to libpurple log 2014-08-22 17:39:05 +02:00
mjentsch
e4bb5bf5a6 Count pending queries using the elements in the query tree, instead of counting the incoming and outgoing messages
Since the server is able to send queries without any response, and is also able to send multiple responses to an arbitrary query, the current way to count pending queries is not accurate and will lead to errors. Instead, the amount of queries in the query tree will be determined to decide whether there are pending messages.
2014-08-22 17:21:46 +02:00
mjentsch
32799a9086 Move binlog globals into a structure 2014-08-22 17:05:29 +02:00
mjentsch
1170ae5710 Implement state machine for dc discovery and login. 2014-08-08 08:45:58 +02:00
mjentsch
9e5b4ca5ec Refactor - Intermediate Commit 3 2014-08-06 19:45:46 +02:00
mjentsch
8a2c043db4 Refactor - Intermediate Commit 2 2014-07-29 15:36:59 +02:00
mjentsch
ed7aa7de5b Refactor Intermediate State 1 2014-07-29 15:36:59 +02:00
mjentsch
f78adc8b96 Support sending messages 2014-07-11 02:19:05 +02:00
mjentsch
d712b7e17f Add possibillity to listen to created users, chats and groups with event handlers and add some ability to exchange output functions with own callbacks 2014-06-22 23:36:52 +02:00
mjentsch
62090b3ca0 Implement login and authentication mechanism and fix the logging mechanism
Use purple debugging functions by formatting the string beforehand and then passing the readily formatted string, instead of doing it with va_list. Log into the telegram network using the provided SMS code and hash or request a new one, in case one of those isn't provided. Store and load the state using the file config/auth, to be able to restore previous logins.
2014-06-15 13:38:38 +02:00
mjentsch
377c809ba7 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
Dennis Koot
3fe6641dbe use the right .pub file since commit #ff14a08d53ac9e223ffada8a41e69ebb673aa7d7 changed tg.pub to tg-server.pub 2014-03-21 16:34:06 +01:00
mk-pmb
eb7ce437af Enhance naming to show that the pubkey is the server's.
While I'm at it, also label the magic constants for prng_seed
to avoid confusion with srand(0).
2014-03-11 15:10:19 +01:00
vysheng
2d7fbe769e added support for update_dc 2014-03-07 23:15:57 +04:00
Dmitrij D. Czarkoff
333f48e826 Added support for OpenBSD 2014-02-25 16:42:37 +01:00
Vysheng
73a48816e4 Added /etc/telegram/server.pub as default server public key place 2014-02-04 20:35:16 +04:00
Vysheng
e10ce5aa69 Use tree for peer_name search 2014-01-31 20:03:40 +04:00
Vysheng
f42ef2de5f mtproto-client: do not use TCPQUICKACK in cygwin 2014-01-30 15:45:01 +04:00
vysheng
59e9053910 Deleted aio.h include 2014-01-27 19:10:02 +04:00
antma
ceb9422ae9 add check that BN_is_prime return value is not negative
fix memory leak (BN_clear doesn't release allocated memory)
2014-01-21 18:24:40 +04:00
antma
c91d47839c improve portability by removing rdtsc calls
https://github.com/vysheng/tg/issues/8
2014-01-15 19:29:26 +04:00
antma
eb2bc7f0ff fix #include "config.h" for all source files 2014-01-13 17:05:25 +04:00
vysheng
0a9532dc48 Merge branch 'master' of https://github.com/antma/tg
Conflicts:
	tools.c
2014-01-10 21:16:26 +04:00
antma
afdcd9b7df fix missed inflateEnd call and enhance handling inflate return value 2014-01-10 20:54:47 +04:00
vysheng
feed5229b5 free->tfree. Memory checks, if compiled with -DDEBUG 2014-01-10 18:37:56 +04:00