Git Product home page Git Product logo

tg's Introduction

Telegram messenger CLI Build Status

Command-line interface for Telegram. Uses readline interface.

API, Protocol documentation

Documentation for Telegram API is available here: http://core.telegram.org/api

Documentation for MTproto protocol is available here: http://core.telegram.org/mtproto

Upgrading to version 1.0

First of all, the binary is now in ./bin folder and is named telegram-cli. So be careful, not to use old binary.

Second, config folder is now ${HOME}/.telegram-cli

Third, database is not compatible with older versions, so you'll have to login again.

Fourth, in peer_name '#' are substitued to '@'. (Not applied to appending of '#%d' in case of two peers having same name).

Installation

Clone GitHub Repository

 git clone --recursive https://github.com/vysheng/tg.git && cd tg

Python Support

Python support is currently limited to Python 2.7 or Python 3.1+. Other versions may work but are not tested.

Linux and BSDs

Install libs: readline, openssl and (if you want to use config) libconfig, liblua, python and libjansson. If you do not want to use them pass options --disable-libconfig, --disable-liblua, --disable-python and --disable-json respectively.

On Ubuntu/Debian use:

 sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make 

On gentoo:

 sudo emerge -av sys-libs/readline dev-libs/libconfig dev-libs/openssl dev-lang/lua dev-libs/libevent dev-libs/jansson dev-lang/python

On Fedora:

 sudo dnf install lua-devel openssl-devel libconfig-devel readline-devel libevent-devel libjansson-devel python-devel

On Archlinux:

 yaourt -S telegram-cli-git

On FreeBSD:

 pkg install libconfig libexecinfo lua52 python

On OpenBSD:

 pkg_add libconfig libexecinfo lua python

On openSUSE:

 sudo zypper in lua-devel libconfig-devel readline-devel libevent-devel libjansson-devel python-devel libopenssl-devel

Then,

 ./configure
 make

Other methods to install on linux

On Gentoo: use ebuild provided.

On Arch: https://aur.archlinux.org/packages/telegram-cli-git

Mac OS X

The client depends on readline library and libconfig, which are not included in OS X by default. You have to install these libraries manually.

If using Homebrew:

 brew install libconfig readline lua python libevent jansson
 export CFLAGS="-I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include"
 export LDFLAGS="-L/usr/local/lib -L/usr/local/Cellar/readline/6.3.8/lib"
 ./configure && make

Thanks to @jfontan for this solution.

If using MacPorts:

 sudo port install libconfig-hr
 sudo port install readline
 sudo port install lua51
 sudo port install python34
 sudo port install libevent
 export CFLAGS="-I/usr/local/include -I/opt/local/include -I/opt/local/include/lua-5.1"
 export LDFLAGS="-L/usr/local/lib -L/opt/local/lib -L/opt/local/lib/lua-5.1"
 ./configure && make

Install these ports:

  • devel/libconfig
  • devel/libexecinfo
  • lang/lua52

Then build:

 env CC=clang CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib LUA=/usr/local/bin/lua52 LUA_INCLUDE=-I/usr/local/include/lua52 LUA_LIB=-llua-5.2 ./configure
 make

Other UNIX

If you manage to launch it on other UNIX, please let me know.

Contacts

If you would like to ask a question, you can write to my telegram or to the github (or both). To contact me via telegram, you should use import_card method with argument 000653bf:0738ca5d:5521fbac:29246815:a27d0cda

Usage

bin/telegram-cli -k <public-server-key>

By default, the public key is stored in tg-server.pub in the same folder or in /etc/telegram-cli/server.pub. If not, specify where to find it:

bin/telegram-cli -k tg-server.pub

Client support TAB completion and command history.

Peer refers to the name of the contact or dialog and can be accessed by TAB completion. For user contacts peer name is Name Lastname with all spaces changed to underscores. For chats it is it's title with all spaces changed to underscores For encrypted chats it is <Exсlamation mark> Name Lastname with all spaces changed to underscores.

If two or more peers have same name, number is appended to the name. (for example A_B, A_B#1, A_B#2 and so on)

Supported commands

Messaging

  • msg <peer> Text - sends message to this peer
  • fwd <user> <msg-seqno> - forward message to user. You can see message numbers starting client with -N
  • chat_with_peer <peer> starts one on one chat session with this peer. /exit or /quit to end this mode.
  • add_contact <phone-number> <first-name> <last-name> - tries to add contact to contact-list by phone
  • rename_contact <user> <first-name> <last-name> - tries to rename contact. If you have another device it will be a fight
  • mark_read <peer> - mark read all received messages with peer
  • delete_msg <msg-seqno> - deletes message (not completly, though)
  • restore_msg <msg-seqno> - restores delete message. Impossible for secret chats. Only possible short time (one hour, I think) after deletion

Multimedia

  • send_photo <peer> <photo-file-name> - sends photo to peer
  • send_video <peer> <video-file-name> - sends video to peer
  • send_text <peer> <text-file-name> - sends text file as plain messages
  • load_photo/load_video/load_video_thumb/load_audio/load_document/load_document_thumb <msg-seqno> - loads photo/video/audio/document to download dir
  • view_photo/view_video/view_video_thumb/view_audio/view_document/view_document_thumb <msg-seqno> - loads photo/video to download dir and starts system default viewer
  • fwd_media <msg-seqno> send media in your message. Use this to prevent sharing info about author of media (though, it is possible to determine user_id from media itself, it is not possible get access_hash of this user)
  • set_profile_photo <photo-file-name> - sets userpic. Photo should be square, or server will cut biggest central square part

Group chat options

  • chat_info <chat> - prints info about chat
  • chat_add_user <chat> <user> - add user to chat
  • chat_del_user <chat> <user> - remove user from chat
  • rename_chat <chat> <new-name>
  • create_group_chat <chat topic> <user1> <user2> <user3> ... - creates a groupchat with users, use chat_add_user to add more users
  • chat_set_photo <chat> <photo-file-name> - sets group chat photo. Same limits as for profile photos.

Search

  • search <peer> pattern - searches pattern in messages with peer
  • global_search pattern - searches pattern in all messages

Secret chat

  • create_secret_chat <user> - creates secret chat with this user
  • visualize_key <secret_chat> - prints visualization of encryption key. You should compare it to your partner's one
  • set_ttl <secret_chat> <ttl> - sets ttl to secret chat. Though client does ignore it, client on other end can make use of it
  • accept_secret_chat <secret_chat> - manually accept secret chat (only useful when starting with -E key)

Stats and various info

  • user_info <user> - prints info about user
  • history <peer> [limit] - prints history (and marks it as read). Default limit = 40
  • dialog_list - prints info about your dialogs
  • contact_list - prints info about users in your contact list
  • suggested_contacts - print info about contacts, you have max common friends
  • stats - just for debugging
  • show_license - prints contents of GPLv2
  • help - prints this help
  • get_self - get our user info

Card

  • export_card - print your 'card' that anyone can later use to import your contact
  • import_card <card> - gets user by card. You can write messages to him after that.

Other

  • quit - quit
  • safe_quit - wait for all queries to end then quit

tg's People

Contributors

adrocniimai avatar asdofindia avatar burunduk3 avatar bwesterb avatar czarkoff avatar dannluciano avatar danog avatar falkartis avatar floens avatar gahr avatar gfleury avatar ied206 avatar iranzo avatar jubalh avatar kartikm avatar koter84 avatar luckydonald avatar lwhsu avatar mamal72 avatar mapio avatar michelesr avatar mk-pmb avatar nullifye avatar schroedingerszombie avatar stillru avatar surye avatar tazhate avatar vysheng avatar yagop avatar zhukov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tg's Issues

Create tags for releases

The debian/watch file points to the tag page to look for new versions:

https://github.com/vysheng/tg/tags .*/v?(\d\S*)\.tar\.gz

The current version is 0.01 so there should be a tag for it:

tg/main.c

Line 61 in b97769b

#define VERSION "0.01"

I am planning to create a Debian package for the Ubuntu software site getdeb.net
A working watch file would mean that new versions are found easily.

Didn't ask me "register? Username?" on first run

$ ./telegram -k tg.pub
Telegram-client version 0.01-beta, Copyright (C) 2013 Vitaly Valtman
Telegram-client comes with ABSOLUTELY NO WARRANTY; for details type show_license'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow_license' for details.
[/home/akshay/.telegram] created
[/home/akshay/.telegram/downloads] created
Telephone number (with '+' sign): +919xxxxxxxxx
*** phone registered
*** sending code
*** send_code: dc_num = 4
Code from sms: xxxxx
*** error_code = 400, error = PHONE_NUMBER_UNOCCUPIED
telegram: queries.c:605: sign_in_on_error: Assertion `0' failed.
Signal 6 received
./telegram(print_backtrace+0x1c)[0x40cadc]
./telegram(sig_handler+0x28)[0x40cb28]
/lib/x86_64-linux-gnu/libc.so.6(+0x370b0)[0x7f4d827ed0b0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f4d827ed037]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f4d827f0698]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fe03)[0x7f4d827e5e03]
/lib/x86_64-linux-gnu/libc.so.6(+0x2feb2)[0x7f4d827e5eb2]
./telegram[0x41c053]
./telegram(query_error+0x190)[0x421ad0]
./telegram(process_rpc_message+0x231)[0x41b841]
./telegram(rpc_execute+0x25f)[0x41bccf]
./telegram(try_rpc_read+0x9e)[0x4137ee]
./telegram(connections_poll_result+0xa8)[0x413d58]
./telegram(net_loop+0xea)[0x40d7ca]
./telegram(do_send_code_result+0xa8)[0x4229b8]
./telegram(loop+0x475)[0x40e835]
./telegram(main+0x6d)[0x40c01d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f4d827d7ea5]
./telegram[0x40c04d]

$ ./telegram -k tg.pub
Telegram-client version 0.01-beta, Copyright (C) 2013 Vitaly Valtman
Telegram-client comes with ABSOLUTELY NO WARRANTY; for details type show_license'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow_license' for details.
Telephone number (with '+' sign): +919xxxxxxxxx
*** phone not registered
User is not registered. Do you want to register? [Y/n] y
Ok, starting registartion.
Name: Akshay S Dinesh
Name: asdofindia
*** sending code
*** send_code: dc_num = 4
Code from sms: xxxxx

stats

Crash

[15:18] User Кирилл [kirillbashik] Баш updated profile photo

telegram: structures.c:51: fetch_file_location: Assertion `x == 0x53d69076' failed.
Signal 6 received
./telegram(print_backtrace+0x1c)[0x40b2ec]
./telegram[0x40b338]
/lib64/libc.so.6(+0x37c90)[0x7f5e52afcc90]
/lib64/libc.so.6(gsignal+0x35)[0x7f5e52afcc15]
/lib64/libc.so.6(abort+0x17b)[0x7f5e52afe08b]
/lib64/libc.so.6(+0x30c7e)[0x7f5e52af5c7e]
/lib64/libc.so.6(+0x30d22)[0x7f5e52af5d22]
./telegram[0x422e91]
./telegram(work_update+0x1b9a)[0x41615a]
./telegram(get_difference_on_answer+0x23d)[0x4222dd]
./telegram(query_result+0x91)[0x41c171]
./telegram(process_rpc_message+0x211)[0x417791]
./telegram(rpc_execute+0xef)[0x417a0f]
./telegram(try_rpc_read+0x9e)[0x410fbe]
./telegram(connections_poll_result+0xb8)[0x411478]
./telegram(net_loop+0xfb)[0x40bf9b]
./telegram(main_loop+0x13)[0x40c0b3]
./telegram(loop+0x1c5)[0x40cd45]
./telegram(main+0x55)[0x40a905]
/lib64/libc.so.6(__libc_start_main+0xed)[0x7f5e52ae960d]
./telegram[0x40a935]

Compile error

tg-master$ make
gcc -g -O2 -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c main.c -o main.o
main.c: In function ‘parse_config’:
main.c:266:3: error: passing argument 3 of ‘config_lookup_int’ from incompatible pointer type [-Werror]
/usr/include/libconfig.h:235:26: note: expected ‘long int ’ but argument is of type ‘int *’
cc1: all warnings being treated as errors
make: *
* [main.o] Error 1
tg-master$

Building on Ubuntu 12.04.3 LTS x86_64

Archlinux support

Would be good if someone could check archlinux support, and if it works, make a package build (PKGBUILD) to upload the application to the AUR.

command-line argument passing

The command-line CLI is working pretty smoothly.

I tried some stdin-passing but without success.

tg-master$ echo "msg peer_name test" | ./telegram -k tg.pub
Telegram-client version 0.01-beta, Copyright (C) 2013 Vitaly Valtman
Telegram-client comes with ABSOLUTELY NO WARRANTY; for details type show_license'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow_license' for details.
tcgetattr(): Inappropriate ioctl for device

Am I missing something or is it an RFE ? :)

crash

[1 unread]> telegram: binlog.c:690: replay_log_event: Assertion `C->user_list[i].user_id != user' failed.
Signal 6 received
telegram(print_backtrace+0x1c)[0x40da2c]
telegram[0x40da78]
/lib64/libc.so.6(+0x38350)[0x7fbce2fc4350]
/lib64/libc.so.6(gsignal+0x35)[0x7fbce2fc42d5]
/lib64/libc.so.6(abort+0x148)[0x7fbce2fc5758]
/lib64/libc.so.6(+0x31392)[0x7fbce2fbd392]
/lib64/libc.so.6(+0x31442)[0x7fbce2fbd442]
telegram(replay_log_event+0x48f2)[0x437932]
telegram(add_log_event+0x8a)[0x43830a]
telegram(work_update+0xae3)[0x418873]
telegram(work_updates+0xd6)[0x41a066]
telegram(work_packed+0x189)[0x41ae49]
telegram(process_rpc_message+0x211)[0x41b391]
telegram(rpc_execute+0x25f)[0x41b78f]
telegram(try_rpc_read+0x9e)[0x4140de]
telegram(connections_poll_result+0xa8)[0x414598]
telegram(net_loop+0xea)[0x40e70a]
telegram(main_loop+0x13)[0x40e833]
telegram(loop+0x1d5)[0x40f4f5]
telegram(main+0x5c)[0x40cf8c]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fbce2fb09b5]
telegram[0x40cfbd]

Problem on mac 10.9

I have problem on my mac

MacBook-Pro-Nikita:tg nikita$ ./telegram -k tg.pub
Telegram-client version 0.01-beta, Copyright (C) 2013 Vitaly Valtman
Telegram-client comes with ABSOLUTELY NO WARRANTY; for details type show_license'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow_license' for details.
Telephone number (with '+' sign): +7xxxxxxxxxx
*** phone registered
*** sending code
*** send_code: dc_num = 2
Code from sms: 76778
Assertion failed: (y == CODE_user_profile_photo), function fetch_user, file structures.c, line 205.
Signal 6 received
0 telegram 0x000000010f5ebcfc print_backtrace + 28
1 telegram 0x000000010f5ebd59 sig_handler + 41
2 libsystem_platform.dylib 0x00007fff9008d5aa _sigtramp + 26
3 ??? 0x00007fff506154f0 0x0 + 140734541944048
4 libsystem_c.dylib 0x00007fff89b05bba abort + 125
5 libsystem_c.dylib 0x00007fff89acfa5f basename + 0
6 telegram 0x000000010f60c05b fetch_user + 1083
7 telegram 0x000000010f602f3a sign_in_on_answer + 106
8 telegram 0x000000010f601067 query_result + 887
9 telegram 0x000000010f5fe794 work_rpc_result + 180
10 telegram 0x000000010f5fe416 rpc_execute_answer + 646
11 telegram 0x000000010f5ff2e7 process_rpc_message + 1527
12 telegram 0x000000010f5f8996 rpc_execute + 566
13 telegram 0x000000010f5f607f try_rpc_read + 1103
14 telegram 0x000000010f5f628d try_read + 509
15 telegram 0x000000010f5f64e9 connections_poll_result + 137
16 telegram 0x000000010f5ec04d net_loop + 605
17 telegram 0x000000010f6031be do_send_code_result + 174
18 telegram 0x000000010f5eeca9 loop + 1161
19 telegram 0x000000010f5eba8d inner_main + 13
20 telegram 0x000000010f5ebde3 main + 131
21 libdyld.dylib 0x00007fff8e4b95fd start + 1

Error 17

*** bad_msg_notification: msg_id = 5976720082993144832, seq = 1, error = 17
*** bad_msg_notification: msg_id = 5976720082993144836, seq = 2, error = 17
*** bad_msg_notification: msg_id = 5976720082993144840, seq = 4, error = 17
*** bad_msg_notification: msg_id = 5976720082993144844, seq = 6, error = 17

Toggle info output

Hello! Thnx for awesome client!

How can i turn off online\offline notifications?

Chat admin features

I'd like to ban, add users to chat, etc from client.

I think, it is usefull feature.

crash

[12:22] Chat [#реформы] changed list: now 9 members

telegram: mtproto-client.c:980: work_update: Assertion `fetch_int () == 0x7841b415' failed.
Signal 6 received
telegram(print_backtrace+0x1c)[0x40ccbc]
telegram[0x40cd08]
/lib64/libc.so.6(+0x37c90)[0x7f02bc27fc90]
/lib64/libc.so.6(gsignal+0x35)[0x7f02bc27fc15]
/lib64/libc.so.6(abort+0x17b)[0x7f02bc28108b]
/lib64/libc.so.6(+0x30c7e)[0x7f02bc278c7e]
/lib64/libc.so.6(+0x30d22)[0x7f02bc278d22]
telegram(work_update+0x1e26)[0x418b36]
telegram(get_difference_on_answer+0x24d)[0x424b9d]
telegram(query_result+0x91)[0x41f331]
telegram(process_rpc_message+0x211)[0x419e81]
telegram(rpc_execute+0x25f)[0x41a26f]
telegram(try_rpc_read+0x9e)[0x41301e]
telegram(connections_poll_result+0xb8)[0x4134d8]
telegram(net_loop+0xfb)[0x40d9db]
telegram(main_loop+0x13)[0x40daf3]
telegram(loop+0x1ab)[0x40e7ab]
telegram(main+0x5c)[0x40c26c]
/lib64/libc.so.6(__libc_start_main+0xed)[0x7f02bc26c60d]
telegram[0x40c29d]

Checking for library containing lua_load... no

Hello
I'm trying to compile In FreeBSD 10

FreeBSD fbsd 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Fri Jan 17 01:46:25 UTC 2014

Clone GitHub Repository

$ git clone https://github.com/vysheng/tg.git && cd tg

Install these ports:
devel/libconfig
devel/libexecinfo

Then build:

$ env CC=clang CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib LUA=/usr/local/bin/lua51/lua LUA_LIB=-l/usr/local/lib/lua51 ./configure

And I have this:

checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for sqrt in -lm... yes
checking for library containing clock_gettime... none required
checking for library containing backtrace... -lexecinfo
checking for inflate in -lz... yes
checking for AES_set_encrypt_key in -lcrypto... yes
checking for rl_save_prompt in -lreadline... yes
checking for libconfig... enabled
checking for config_init in -lconfig... yes
checking for liblua... checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
enabled
checking if /usr/local/bin/lua51/lua is a Lua interpreter... yes
checking for lua version... Hello Lua 5.1!
5.1
checking for lua platform... unknown
checking for lua script directory... ${prefix}/share/lua/5.1
checking for lua module directory... ${exec_prefix}/lib/lua/5.1
checking if LUA_VERSION is defined... yes
checking lua.h usability... no
checking lua.h presence... no
checking for lua.h... no
checking lualib.h usability... no
checking lualib.h presence... no
checking for lualib.h... no
checking lauxlib.h usability... no
checking lauxlib.h presence... no
checking for lauxlib.h... no
checking luaconf.h usability... no
checking luaconf.h presence... no
checking for luaconf.h... no
checking for Lua headers in... /usr/local/include/lua51
checking lua.h usability... yes
checking lua.h presence... yes
checking for lua.h... yes
checking lualib.h usability... yes
checking lualib.h presence... yes
checking for lualib.h... yes
checking lauxlib.h usability... yes
checking lauxlib.h presence... yes
checking for lauxlib.h... yes
checking luaconf.h usability... yes
checking luaconf.h presence... yes
checking for luaconf.h... yes
checking for Lua header version... 5.1
checking if Lua header version matches 5.1... yes
checking if LUA_VERSION is defined... yes
checking for library containing lua_load... no
configure: error: cannot find libs for specified LUA_LIB

But I have Lua instaled:

# pkg version | grep lua
lua-5.1.5_6                        =
lua-mode.el-1.26_1                 =
lua52-5.2.3_2                      =

And

# ls /usr/local/lib/lua51/
liblua-5.1.so.1 liblua.a    liblua.so

Can You help me, pleas!

CLI fails to start in Linux64

Hi folks,

not sure if ./configure went through smoothly. Receiving this:

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for sqrt in -lm... yes
checking for AES_set_encrypt_key in -lcrypto... no
checking for rl_save_prompt in -lreadline... no
checking for rl_set_prompt in -ledit... no
checking for clock_gettime in -lrt... yes
checking Checking for libconfig... enabled
checking for config_init in -lconfig... no
configure: error: No libconfig found. Try --disable-libconfig

When "make" ist invoked:

gcc -g -O2 -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c main.c -o main.o
main.c:31:31: fatal error: readline/readline.h: No such file or directory
compilation terminated.
make: *** [main.o] Error 1


On a side note: needed to change untar'ing (tar xzf ./tg-master.zip && cd tg-master) and used unzip command as followed:
unzip ./tg-master.zip -d .

Any idea what is wrong? Any help appreciated.. thanks!

Best, Mariusz

Echo from command line

Hi guys,

I try from command line:
echo 'msg user test10\n' | ./telegram -k tg.pub

i get: bad user/chat id

Is there a way to send msg directly from command line ?
(so i could use it for my servers monitoring tools)

Thanks

Theodore

No way to get message id's

I cannot find a way to guess the id/seqno number of a previously sent/received message (e.g. to forward it or to download a picture). Could it be possible to add an option to display id numbers in the output of the history command?

Traceback when trying to close a chat with CTRL-D

Hi,
When using CTRL-D to close a chat a traceback is printed instead of going up on level to the general list:

SIGSEGV received
telegram(print_backtrace+0x1c)[0x40cd0c]
telegram(sig_segv_handler+0x22)[0x40cd52]
/lib64/libc.so.6[0x3280235cb0]
telegram(interpreter_chat_mode+0x19)[0x40fc19]
telegram(interpreter+0xcd)[0x4100ad]
/lib64/libreadline.so.6(rl_callback_read_char+0x8e)[0x329ec2acee]
telegram(net_loop+0xdd)[0x40da1d]
telegram(loop+0x224)[0x40e834]
telegram(main+0x6d)[0x40c21d]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x3280221d65]
telegram[0x40c24d]

Can't build on ubuntu 12.04.

Managed to find the corresponding libraries for readline and libconfig on ubuntu.
Did the following.

sudo apt-get install libconfig8-dev - libconfig

sudo apt-get install libreadline-gplv2-dev readline

configure runs smoothly but when making throws up the following error.

gcc main.o loop.o interface.o net.o mtproto-common.o mtproto-client.o queries.o structures.o binlog.o -lm -lcrypto -lz -lssl -rdynamic -ggdb -ledit -lrt -lconfig -o telegram /usr/bin/ld: cannot find -ledit collect2: ld returned 1 exit status make: *** [telegram] Error 1

LUA in OSX 10.9.1 problem and fix.

Hi,

I had a problem installing in OSx when ./configure :
configure: error: No lua found. Try --disable-liblua

For those who has this problem is just:
brew install lua

and everything went fine.

Thank you guys for the client!

Compile Error - binlog.c

binlog.c: In function ‘add_log_event’:
binlog.c:806:5: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Werror=format]
cc1: all warnings being treated as errors
make: *** [binlog.o] Error 1

Translate users in groups to names

Actually, when a user writes in a group chat it appears as:

"Named channel " user#12345656 >>> message
It would be nice to have that user # translated to real username to better understand the conversations

Error 401

I press in my phone "Close all sessions" and now i cant use Telegram on linux.
I see this message on terminal "#401 :SESSION_REVOKED".

What can i do to solve it?

Support cygwin

Hi!

Before the unashamed request, thank you very much for developing this program. I enjoy using it daily on GNU/Linux (Gentoo) and, ocassionally, on FreeBSD, so happy user here.

Do you plan to support cygwin at any near/far future?[1]

Cheers

[1] Now build fails at its early stages, due to execinfo.h missing...

Proxy support

It would be nice if the application support HTTP proxy configuration.

The problem with the сyrillic

I successfully get a message with the Cyrillic alphabet, but can not send. Not sure about this problem on my side or a problem in the client.

ox x 10.9, iterm 2

Terminal Bell event on new message

Hi, I would like to ask if is possible to add this feature to warn users when a new message arrives.
I would find it very useful because I usually leave the client open on an empty workspace instead of the one where I am working (I'm using a tiling WM) and I have to manually check the presence of new messages periodically.

Change phone number

Hi,

I want to change my phone number,

Download source package and build telegram-client, but when start telegram-client, take the another number.

How can have 2 telegram-client on more in the same pc

thanks.

Thank

Build error on Mac OS X: "-Wno-deprecated" is valid for C++/Java/ObjC++ but not for C

Compiling on Mac OS 10.8.5 following the Mac build instructions yields this:

gcc -I/usr/local/include -I/usr/local/Cellar/readline/6.2.4/include  -DHAVE_CONFIG_H -Wall -Wextra -Werror -Wno-deprecated -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -I. -I. -c main.c -o main.o
cc1: warnings being treated as errors
cc1: warning: command line option "-Wno-deprecated" is valid for C++/Java/ObjC++ but not for C
make: *** [main.o] Error 1

It's fixable by removing "-Werror" from Makefile.in:7, but I'm not sure if that's something you want to do.

Assertion failed in queries.c

It happened to me three times already. I think that this comes up when I'm idle for some time and the client tries to reconnect.

Here's what I get on command line, I'll try to reproduce it with more verbose (debug) logs:

 *** Lost connection to server... 31.210.235.12:80
 *** connection ready
 *** Lost connection to server... 31.210.235.12:25
 *** Lost connection to server... 31.210.235.12:443
[1 unread]telegram: queries.c:259: tree_insert_timer: Assertion `c' failed.
Signal 6 received
./telegram(print_backtrace+0x1c)[0x40c99c]
./telegram(sig_handler+0x28)[0x40c9e8]
/lib/x86_64-linux-gnu/libc.so.6(+0x370b0)[0x7f36a8aa50b0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f36a8aa5037]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f36a8aa8698]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fe03)[0x7f36a8a9de03]
/lib/x86_64-linux-gnu/libc.so.6(+0x2feb2)[0x7f36a8a9deb2]
./telegram(tree_merge_timer+0x0)[0x420340]
./telegram(insert_event_timer+0x46)[0x420726]
./telegram(restart_connection+0x1b8)[0x412fe8]
./telegram(connections_poll_result+0x42)[0x413af2]
./telegram(net_loop+0xea)[0x40d68a]
./telegram(main_loop+0x13)[0x40d7c3]
./telegram(loop+0x1da)[0x40e45a]
./telegram(main+0x6d)[0x40bedd]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f36a8a8fea5]
./telegram[0x40bf0d]

Support for whitespaces in file/dir names

Hi vysheng

When I try to send files it can't get through paths containing whitespaces, i.e. :

send_photo User /home/gabriel/My Pics Dir/one_photo.jpg
No such file '/home/gabriel/My'

The autocompletion works, but it doesn't escape whitespaces when I try to send the file.

Command Line Argument - CLI issue

Hi,
From command line, The messages are not going. Interactive is working fine.

echo "msg Jobin_J hello" |./telegram -k tg.pub
Telegram-client version 0.01-beta, Copyright (C) 2013 Vitaly Valtman
Telegram-client comes with ABSOLUTELY NO WARRANTY; for details type show_license'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow_license' for details.

msg Jobin_J hello
Bad user/chat id
User Jobin J: 3 unread

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.