Commit 3e62e525 authored by Vysheng's avatar Vysheng

Merge github.com:vysheng/tg

parents 9a494d8f 7064f514
This diff is collapsed.
...@@ -5,12 +5,17 @@ Command-line interface for [Telegram](http://telegram.org). Uses readline interf ...@@ -5,12 +5,17 @@ Command-line interface for [Telegram](http://telegram.org). Uses readline interf
### API, Protocol documentation ### API, Protocol documentation
Documentation for Telegram API is available here: http://core.telegram.org/api Documentation for Telegram API is available here: http://core.telegram.org/api
Documentation for MTproto protocol is available here: http://core.telegram.org/mtproto Documentation for MTproto protocol is available here: http://core.telegram.org/mtproto
### Installation ### Installation
Just run `make` Just run `make`
#### Requirements
Currently only Linux OS is supported. But if you manage to launch it on OS X or other UNIX, please let me know.
### Usage ### Usage
./telegram -k <public-server-key> ./telegram -k <public-server-key>
......
...@@ -64,6 +64,7 @@ char *commands[] = { ...@@ -64,6 +64,7 @@ char *commands[] = {
"send_video", "send_video",
"send_text", "send_text",
"chat_info", "chat_info",
"show_license",
0 }; 0 };
int commands_flags[] = { int commands_flags[] = {
...@@ -77,6 +78,7 @@ int commands_flags[] = { ...@@ -77,6 +78,7 @@ int commands_flags[] = {
0732, 0732,
0732, 0732,
074, 074,
07,
}; };
char *a = 0; char *a = 0;
...@@ -365,6 +367,13 @@ void interpreter (char *line UU) { ...@@ -365,6 +367,13 @@ void interpreter (char *line UU) {
pop_color (); pop_color ();
print_end (); print_end ();
printf ("\033[1K\033H"); printf ("\033[1K\033H");
} else if (!memcmp (line, "show_license", 12)) {
char *b =
#include "LICENSE.h"
;
print_start ();
printf ("%s", b);
print_end ();
} }
} }
......
...@@ -244,6 +244,13 @@ int main (int argc, char **argv) { ...@@ -244,6 +244,13 @@ int main (int argc, char **argv) {
signal (SIGABRT, sig_handler); signal (SIGABRT, sig_handler);
running_for_first_time (); running_for_first_time ();
printf (
"Telegram-client version " TG_VERSION ", Copyright (C) 2013 Vitaly Valtman\n"
"Telegram-client comes with ABSOLUTELY NO WARRANTY; for details type `show_license'.\n"
"This is free software, and you are welcome to redistribute it\n"
"under certain conditions; type `show_license' for details.\n"
);
get_terminal_attributes (); get_terminal_attributes ();
args_parse (argc, argv); args_parse (argc, argv);
......
...@@ -27,6 +27,8 @@ struct dc; ...@@ -27,6 +27,8 @@ struct dc;
#define TG_APP_HASH "36722c72256a24c1225de00eb6a1ca74" #define TG_APP_HASH "36722c72256a24c1225de00eb6a1ca74"
#define TG_APP_ID 2899 #define TG_APP_ID 2899
#define TG_VERSION "0.01-beta"
#define ACK_TIMEOUT 60 #define ACK_TIMEOUT 60
#define MAX_DC_ID 10 #define MAX_DC_ID 10
......
...@@ -59,7 +59,6 @@ int alarm_query (struct query *q) { ...@@ -59,7 +59,6 @@ int alarm_query (struct query *q) {
if (verbosity) { if (verbosity) {
logprintf ("Alarm query %lld\n", q->msg_id); logprintf ("Alarm query %lld\n", q->msg_id);
} }
tree_delete_query (queries_tree, q);
q->ev.timeout = get_double_time () + QUERY_TIMEOUT; q->ev.timeout = get_double_time () + QUERY_TIMEOUT;
insert_event_timer (&q->ev); insert_event_timer (&q->ev);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment