Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major fixes and improvements #1577

Open
wants to merge 237 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
648a063
Added make rule install
dannluciano Dec 1, 2013
d7b2026
Update debian/control
kartikm Feb 21, 2014
b341233
Updated changelog
kartikm Feb 21, 2014
2780a71
a man page for tg
Jun 10, 2014
f9f2a90
man page
Jun 10, 2014
bfb4717
/read and /history
Jul 18, 2014
4daedd8
Add default server.pub to /etc/telegram
vrruiz Jul 31, 2014
2c4f07e
Remove unneeded Mac OS X instructions
anddam Aug 20, 2014
898c194
Update config.sample
danielberlin Dec 7, 2014
d446f4b
Update config.sample
danielberlin Dec 9, 2014
053a772
Update README.md
tincann Jan 18, 2015
10ba89b
Minor typo correction
yuvallanger Mar 4, 2015
6bba88a
Added username variable to lua c library
zyrorl Apr 5, 2015
7993484
Fix RPM SPEC file, remove existing RPMs, and add a helper script to b…
juliogonzalez May 13, 2015
628abe1
Fix overflow destination buffer error on yosemite
gomayonqui May 26, 2015
e4ff0b2
Added on_msg_history to lua
Aug 12, 2015
4f4efe8
Fix typo in log print of callback
Aug 14, 2015
bf1878a
Added on_msg_history to python
Aug 14, 2015
e67856f
Fix tgl_Peer_getname
javadib Sep 10, 2015
b74be69
Update README-PY.md
javadib Sep 10, 2015
951f807
Fix MarkRead.
javadib Sep 10, 2015
4c97ae9
update dpkg build dependencies
SubOptimal Dec 3, 2015
261a5e5
Having on_loop not defined in a python scripts leads to an error mess…
fabianonline Dec 5, 2015
7ef685f
Updated tg for teleseed
Imandaneshi Dec 7, 2015
e039351
resolve_username in lua
yagop Dec 8, 2015
dc3cdaf
Merge pull request #2 from vysheng/test
yagop Jan 6, 2016
2284d78
get_message Lua function :new_moon_with_face:
yagop Jan 6, 2016
9e14543
Fix crash on unsupported media received
rnhmjoj Jan 8, 2016
b63f6fe
Merge pull request #3 from vysheng/test
yagop Jan 8, 2016
03ecdb6
Add inviter in members table
yagop Jan 8, 2016
bccd1ee
Merge pull request #4 from vysheng/test
yagop Jan 9, 2016
030e2ca
Merge remote-tracking branch 'upstream/master'
Jan 10, 2016
c6ddcad
Merge remote-tracking branch 'upstream/master'
Imandaneshi Jan 11, 2016
483df1e
Merge branch 'pr' of https://github.com/rnhmjoj/tg
Jan 11, 2016
c20d757
Added unblock_user function to lua-tg.c
Rondoozle Jan 13, 2016
a851d3f
README update
Jan 24, 2016
67bcc86
Update README.md, update apt dependencies
PeterDaveHello Jan 28, 2016
bc4a112
Update README.md
PeterDaveHello Jan 28, 2016
74231b5
Fix compilation on FreeBSD
PeterDaveHello Jan 28, 2016
d3d2ab3
Update README.md, OpenBSD/FreeBSD should use gmake
PeterDaveHello Jan 28, 2016
2d63e3a
Update README.md
PeterDaveHello Jan 28, 2016
ca6c683
Fix compilation on FreeBSD
PeterDaveHello Jan 28, 2016
297ac95
Update README.md, OpenBSD/FreeBSD should use gmake
PeterDaveHello Jan 28, 2016
4a931a4
use travis-ci's apt addon to install packages
PeterDaveHello Jan 28, 2016
f94ea02
Enable container-based infrastructure on travis-ci
PeterDaveHello Jan 28, 2016
370b06b
Decrease git clone depth to speed up the build.
PeterDaveHello Jan 28, 2016
b059c2b
add -Wno-unused-function to compile flags
PeterDaveHello Jan 28, 2016
f0410a5
Add new send_*_reply functions
janglapuk Jan 31, 2016
64f1b1a
README update
Feb 3, 2016
2c47452
Fix Fedora libjansson package name
alilotfi Feb 7, 2016
536880f
SuperGroups
Mar 7, 2016
93fc1f9
Update .gitmodules
Rondoozle Mar 8, 2016
1def4cb
SuperGroups and Channels for TeleSeed v4!
Mar 9, 2016
98f36a8
Merge branch 'master' of https://github.com/Rondoozle/tg
Mar 9, 2016
af70511
Update tgl
Mar 9, 2016
aa6b8f4
Merge branch 'test'
Mar 9, 2016
2c67f1e
lua-tg.c fixes
Mar 9, 2016
e2b54ec
lua-tg.c spacing fixes
Mar 9, 2016
5ffb71d
Update tgl and .gitmodules
Mar 9, 2016
ac30a97
Fixes
Mar 9, 2016
3fcbda5
Merge branch 'master' of https://github.com/Rondoozle/tg
Mar 9, 2016
2498545
Updated tgl
Mar 9, 2016
33cf197
Update tgl
Mar 11, 2016
ad44d65
Update lua-tg.c
Mar 17, 2016
c702188
Automatic 'mark_read' after 'msg|reply|fwd'
michelesr Oct 16, 2015
a5119ad
Auto 'mark_read' on msg in 'chat_with_peer' mode
michelesr Oct 16, 2015
55f9fed
Update control with build dep: libjansson
magnific0 Mar 31, 2016
13420a1
Line up command descriptions in 'help'
emlai Apr 1, 2016
d2e6d1a
Update lua-tg.c and tgl
Apr 16, 2016
46224cf
feat(): identifying groups by appending a GROUP: to the message
andreabadesso Apr 16, 2016
d66f8f0
Update tgl
Apr 16, 2016
c238226
Merge branch 'master' of https://github.com/Rondoozle/tg
Apr 16, 2016
cfd6a33
Update tgl
Apr 16, 2016
2485395
Merge branch 'master' of https://github.com/vysheng/tg
Apr 17, 2016
4bf748d
1. fix partial python support for now(type fix)
Cojad Jun 18, 2016
3ff1edf
fix missing header.
Cojad Jun 18, 2016
a77f0b2
adopt to structure tgl_message_id_t
Cojad Jun 18, 2016
48b13cd
Fix python script for variable scope mistake and argument errors for …
Cojad Jun 21, 2016
f219d8d
use travis-ci's apt addon to install packages
PeterDaveHello Jan 28, 2016
dde0e6c
Enable container-based infrastructure on travis-ci
PeterDaveHello Jan 28, 2016
06c2f68
Decrease git clone depth to speed up the build.
PeterDaveHello Jan 28, 2016
99d51d6
add -Wno-unused-function to compile flags
PeterDaveHello Jan 28, 2016
7350a1b
fix travis-ci and update Travis-ci badge in README
Cojad Jun 21, 2016
4e56d78
Add auto_mark_read switch
michelesr Jun 21, 2016
c69b228
adds homebrew formula to readme
ivoputzer Jun 22, 2016
dc9ee85
add support for peer type: channel, fixed some python log does not di…
Cojad Jun 23, 2016
231242d
modified to work without errors under cygwin
kolmogorov42 Jul 24, 2016
89fe661
unused function taken away
kolmogorov42 Jul 24, 2016
41e016a
README improved
kolmogorov42 Jul 25, 2016
079d164
update gentoo ebuild
dmanam Aug 26, 2016
031582b
make python depend on lua and json
dmanam Aug 26, 2016
b85d20c
make none of the use flags default since python depends on the other two
dmanam Aug 26, 2016
6245fce
add spaces for REQUIRED_USE so it actually works
dmanam Aug 26, 2016
6ad8952
undo all that stuff cause apparently it won't compile with python no …
dmanam Aug 26, 2016
87e6ce7
drop python support altogether since it apparently doesn't work
dmanam Aug 26, 2016
adc9931
Changed the venue type to title
aidanlloydtucker Sep 3, 2016
ce43e9c
Added type field for all types
aidanlloydtucker Sep 3, 2016
3bd3f48
Removed unused funtion
aidanlloydtucker Sep 3, 2016
ba5eb64
Switched ??? to unknown for all fields
aidanlloydtucker Sep 4, 2016
ec3d68f
Fixed JSON memory leak as shown in vysheng#1075
aidanlloydtucker Sep 4, 2016
e4ad461
Add the packaging metadata to build the Telegram CLI snap
come-maiz Sep 16, 2016
7a1e0a0
Added unread to dialog list
aidanlloydtucker Oct 1, 2016
db864f8
Build status for the correct project linked
kolmogorov42 Oct 5, 2016
d77bc81
travis-ci build status for the cygwin branch
kolmogorov42 Oct 5, 2016
e978bd9
Update Debian installation instructions
labeneator Oct 25, 2016
d63728a
Add key -X for launching from specific config directory, instead of <…
ArtemProf Nov 3, 2016
0369fce
misspelling
elviraux Nov 12, 2016
c4bead0
Updated build instructions to work on Sierra
gejose Nov 17, 2016
627868e
modified rules file
antosamalona Jan 18, 2017
7fad505
Use correct default config file path on Mac OS X.
alexreg Feb 10, 2017
5f130b4
Fixed OSX build instruction for homebrew
mapio Feb 27, 2017
95d3b2f
fix msg id problem I didn't see.
Cojad Apr 7, 2017
4ad0c92
Update README.es
davrodfer Jul 26, 2017
1caea54
fedora jansson-devel
arindamchoudhury Aug 28, 2017
9055edd
Fix jansson-devel
Aug 28, 2017
bba6089
Add link to docker build set
semenyukdmitry Aug 30, 2017
384b332
Add channel_info command to README
semenyukdmitry Aug 30, 2017
09c76bb
set v6 options
Sep 19, 2017
32abd53
read and write v6 options
Sep 19, 2017
f8e3234
add channel's commands
haghighi Oct 9, 2017
8c889f1
Fixing hard crash everytime when posting to the chat or channel
ninjaboy Oct 16, 2017
be58d39
Removed unused method to pass travis check
ninjaboy Oct 20, 2017
18a4e40
Update MacOS compile instructions
sesam Feb 3, 2018
b3a7c4d
Update readme
lxfr Mar 12, 2018
7ccd059
Updated Fedora jansson-devel dependency
tijptjik Mar 19, 2018
1a0089d
Adds Fedora libgcrypt-devel dependency for --disable-openssl
tijptjik Mar 19, 2018
49d40d6
Trailing space
tijptjik Mar 19, 2018
822bbdb
Update README.md
milisarge May 14, 2018
918a164
Working link for libconfig & more
spookyahell May 21, 2018
00502db
Correct the description of --exec
LorenzoAncora Nov 16, 2018
171718c
Changes tgl submodule to point kenorb-contrib/tgl.git
kenorb Feb 2, 2019
fbbc09d
Merge branch 'master' of https://github.com/Rondoozle/tg
kenorb Feb 2, 2019
a700f97
Fixes from Rondoozle fork
kenorb Feb 2, 2019
f3fe47f
Adds missing libgcrypt-dev for RSA compilation errors as per vysheng/…
kenorb Feb 2, 2019
ab27d08
Stop using -Werror: bad practice as not all warnings are true positiv…
kenorb Feb 2, 2019
41b3a44
Updates tgl
kenorb Feb 2, 2019
311d780
Merge branch 'master' of https://github.com/Cojad/tg
kenorb Feb 2, 2019
06c420f
Merge branch 'master' of https://github.com/aidanlloydtucker/tg
kenorb Feb 2, 2019
e212fa6
Merge branch 'patch-1' of https://github.com/magnific0/tg
kenorb Feb 2, 2019
d7d1026
Merge branch 'patch-1' of https://github.com/alilotfi/tg
kenorb Feb 2, 2019
5d693f4
Merge branch 'master' of https://github.com/ArtemProf/tg
kenorb Feb 2, 2019
7095c38
Merge branch 'master' of https://github.com/alexreg/tg
kenorb Feb 2, 2019
199126a
Merge branch 'patch-1' of https://github.com/mapio/tg
kenorb Feb 2, 2019
8d3e35b
Fix crash on unsupported media received
rnhmjoj Jan 8, 2016
b054c12
Merge branch 'patch-1' of https://github.com/LorenzoAncora/tg
kenorb Feb 3, 2019
d24773b
Merge branch 'master' of https://github.com/antosamalona/tg
kenorb Feb 3, 2019
d85792d
Merge branch 'line-up-command-descriptions' of https://github.com/eml…
kenorb Feb 3, 2019
8a20ba0
Merge branch 'cygwin' of https://github.com/kolmogorov42/tg
kenorb Feb 3, 2019
6cb340b
Merge branch 'master' of https://github.com/amirrezawh/tg
kenorb Feb 3, 2019
0910557
Merge branch 'debian-updates' of https://github.com/kartikm/tg
kenorb Feb 3, 2019
ff8bf63
Merge branch 'update_ubuntu_dep_in_readme' of https://github.com/Pete…
kenorb Feb 3, 2019
ffec10c
Merge branch 'build_optimize' of https://github.com/PeterDaveHello/tg
kenorb Feb 3, 2019
610a1c8
Merge branch 'master' of https://github.com/tijptjik/tg
kenorb Feb 3, 2019
4b9b0c1
Merge branch 'patch-1' of https://github.com/arindamchoudhury/tg
kenorb Feb 3, 2019
c2171e2
Merge branch 'patch-1' of https://github.com/milisarge/tg
kenorb Feb 3, 2019
888f0ae
Merge branch 'ipv6' of https://github.com/frizzlywitch/tg
kenorb Feb 3, 2019
7464d6e
Merge branch 'patch-1' of https://github.com/spookyahell/tg
kenorb Feb 3, 2019
c5592f2
Merge branch 'master' of https://github.com/G2Jose/tg
kenorb Feb 3, 2019
e50d49b
Merge branch 'patch-2' of https://github.com/haghighi-ahmad/tg
kenorb Feb 3, 2019
6c39fcb
Merge branch 'FreeBSD2' of https://github.com/PeterDaveHello/tg
kenorb Feb 3, 2019
2e1095c
Revert "read and write v6 options"
kenorb Feb 3, 2019
5f3c675
Fix Python API documentation errors
Mar 21, 2016
a32ceda
Merge branch 'master' of https://github.com/dlahoti/tg
kenorb Feb 3, 2019
797b9f5
Merge branch 'patch-1' of https://github.com/anddam/tg
kenorb Feb 3, 2019
fa81f45
Merge branch 'add_channel_info_to_readme' of https://github.com/semen…
kenorb Feb 3, 2019
35f24c3
Merge branch 'identify-groups-wip' of https://github.com/Lab21k/tg
kenorb Feb 3, 2019
48c494b
Merge branch 'dev' of https://github.com/michelesr/tg
kenorb Feb 3, 2019
282e109
Correctly set online flag in Peer class (Python)
Rufflewind Apr 14, 2016
a1c2303
Merge branch 'Fix_ChatFailing' of https://github.com/ninjaboy/tg
kenorb Feb 3, 2019
d92fdd7
Merge branch 'fix-rpm' of https://github.com/juliogonzalez/tg
kenorb Feb 3, 2019
bc04057
Merge branch 'master' of https://github.com/zyrorl/tg
kenorb Feb 3, 2019
9fcd3d4
Merge branch 'adds-homebrew-formula-to-readme' of https://github.com/…
kenorb Feb 3, 2019
7eb50a8
Merge branch 'fix-python-on_loop-callback-error' of https://github.co…
kenorb Feb 3, 2019
98e1d4a
Merge branch 'master' of https://github.com/elviraux/tg
kenorb Feb 3, 2019
5af989a
Merge branch 'FreeBSD' of https://github.com/PeterDaveHello/tg
kenorb Feb 3, 2019
0a469e4
Merge branch 'master' of https://github.com/vrruiz/tg
kenorb Feb 3, 2019
7bdab96
Merge branch 'master' of https://github.com/dannluciano/tg
kenorb Feb 3, 2019
59c85a2
Fixes "assertion `TLS->enable_pfs' failed" when usign tg with proxych…
marcosramirezaranda Aug 7, 2015
e6b8952
Merge branch 'patch-2' of https://github.com/danielberlin/tg
kenorb Feb 3, 2019
0035cd4
Set the 'ar' command as variable in Makefile.tgl
flocke Apr 16, 2015
57e02a1
Merge branch 'master' of https://github.com/venam/tg
kenorb Feb 3, 2019
ce99e78
Merge branch 'patch-1' of https://github.com/davrodfer/tg
kenorb Feb 3, 2019
477dd3b
Updates repo link
kenorb Feb 3, 2019
7f3da3a
Merge branch 'master' of https://github.com/gomayonqui/tg
kenorb Feb 3, 2019
2c25913
Correct readline terminating sequences for colors
kyak Aug 30, 2016
472aacd
Merge branch 'patch-1' of https://github.com/lxfr/tg
kenorb Feb 3, 2019
2ffdf3f
Merge branch 'snapcraft' of https://github.com/elopio/tg
kenorb Feb 3, 2019
b78cadc
Merge branch 'master' of https://github.com/labeneator/tg
kenorb Feb 3, 2019
85d48a7
resolved: crash after downloading photo/file in deamon/socket mode (-…
Apr 10, 2015
deb4c58
Merge branch 'patch-1' of https://github.com/tincann/tg
kenorb Feb 3, 2019
1d16924
Merge branch 'add_docker_link' of https://github.com/semenyukdmitry/tg
kenorb Feb 3, 2019
bb90d24
Merge branch 'patch-1' of https://github.com/yuvallanger/tg
kenorb Feb 3, 2019
c8c4867
Merge branch 'patch-1' of https://github.com/sesam/tg
kenorb Feb 3, 2019
29169cd
Merge branch 'debian' of https://github.com/SubOptimal/tg
kenorb Feb 3, 2019
4430541
Fix typo of option in usage
kmyk Oct 14, 2016
ad55199
Fixes conflict
kenorb Feb 3, 2019
ba5d631
Merge branch 'test' of https://github.com/yagop/tg
kenorb Feb 3, 2019
14e8517
Revert "Fixes "assertion `TLS->enable_pfs' failed" when usign tg with…
kenorb Feb 3, 2019
d35abc3
Merge branch 'master' of https://github.com/javadib/tg
kenorb Feb 3, 2019
221b9a3
Lua binding improvements.
Apr 22, 2016
e2b9d3c
Update lua-tg.c
kenorb Feb 3, 2019
2d92ab4
Removes duplicate lq_resolve_username, sort lua_function by name
kenorb Feb 3, 2019
d5c308d
Merge branch 'patch-1' of https://github.com/janglapuk/tg
kenorb Feb 3, 2019
ad538b9
Update README.md
Mar 1, 2016
e6f6a2c
fix: null error string breaks json mode
ant9000 Oct 27, 2015
75729e3
Updated installation instructions using Homebrew
behrangsa Jan 27, 2016
eb9dc73
Removes conflicted line
kenorb Feb 3, 2019
8082714
Removes useless file
kenorb Feb 3, 2019
4d69594
Merge branch 'master' of https://github.com/prsai/tg
kenorb Feb 3, 2019
21b7501
Updates README with table of builds
kenorb Feb 3, 2019
bba2ac5
libssl1.0-dev works, but not libssl-dev
kenorb Mar 14, 2019
67fa951
Added timestamps to typing indicators.
tuncenator May 13, 2019
e4eb11c
Added dates to typing indicators.
tuncenator May 13, 2019
bac16a4
Added date/timestamps to 'marked read' status.
tuncenator May 13, 2019
0bc121a
Changed formatting of date/timestamps on 'read' and 'typing' indicators.
tuncenator May 13, 2019
3ffa177
Changed formatting of date/timestamps on 'read' and 'typing' indicato…
tuncenator May 13, 2019
8ae323c
Added timestamps to status updates and fixed a typo
tuncenator Jul 28, 2019
17e4c39
add info about logout
lgg Dec 29, 2019
bde835a
add info about usernames resolving
lgg Dec 29, 2019
21a73dc
Merge pull request #9 from lgg-create-pr/master
kenorb Jan 6, 2020
34f5551
Merge pull request #10 from tuncenator/master
kenorb Jan 6, 2020
e63c9dd
Change address to new forked repository
kenorb Jan 6, 2020
c00f352
Fix debian libssl dependency
jorgonzalez Feb 1, 2020
e35dc1a
Merge pull request #11 from jorgonzalez/fix-debian-dependency-libssl
kenorb Feb 3, 2020
783f698
debian/control: add missing dependency libgcrypt-dev
karawitan Mar 30, 2020
66bcf7d
debian/rules: configure using prefix=/usr
karawitan Mar 30, 2020
dd912f1
fix install step (telegram -> bin/telegram-cli)
karawitan Mar 30, 2020
a3832ee
debian/rules: prevent run of dh_usrlocal
karawitan Mar 30, 2020
3da0e4a
Merge pull request #15 from berryamin/update-debian-packaging
kenorb Apr 2, 2020
49c4afe
Update Readme
deadda7a Sep 20, 2020
e8052fa
Update FreeBSD installation instructions
0mp Oct 5, 2020
c048e44
README.md updating
Feb 16, 2021
af8db27
Merge pull request #36 from fraanks/fraanks
kenorb Apr 29, 2021
22a7154
Merge pull request #26 from deadda7a/master
kenorb Apr 29, 2021
a234347
Merge pull request #29 from 0mp/patch-1
kenorb Apr 29, 2021
aad2e64
tg: fix build on gcc-10 (-fno-common)
trofi May 29, 2022
7f8f739
Merge pull request #61 from trofi/fix-build-on-gcc-10
kenorb Jul 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ debian/telegram-cli/*
debian/telegram-cli.debhelper.log
debian/telegram-cli.substvars
__pycache__
rpm/BUILD
rpm/BUILDROOT
rpm/RPMS
rpm/SRPMS
rpm/SOURCES
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.git
url = https://github.com/kenorb-contrib/tgl.git
29 changes: 18 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@ compiler:
- gcc
- clang

install:
- sudo apt-get update
- sudo apt-get install libconfig8-dev
- sudo apt-get install libreadline6-dev
- sudo apt-get install libssl-dev
- sudo apt-get install liblua5.2-dev lua5.2
- sudo apt-get install python-dev python
- sudo apt-get install libevent-dev
- sudo apt-get install libjansson-dev
addons:
apt:
packages:
- libconfig8-dev
- libreadline6-dev
- libssl-dev
- liblua5.2-dev
- lua5.2
- python-dev
- python
- libevent-dev
- libjansson-dev

sudo: false

git:
depth: 10

script:
- git submodule update --init --recursive
- ./configure
- make

- make
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.3.4
* set config directory with key -X
* TGL-2.0.3

1.3.3
* support for sending custom keyboard
* fixed contact_search
Expand Down
17 changes: 15 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
srcdir=@srcdir@

TARGET_OS=$(shell uname -s)
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ @OPENSSL_LDFLAGS@
CPPFLAGS=@CPPFLAGS@ @OPENSSL_INCLUDES@
DEFS=@DEFS@
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC
COMPILE_FLAGS=${CFLAGS} ${CPFLAGS} ${CPPFLAGS} ${DEFS} -Wall -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -Wno-unused-function -Wno-builtin-memcpy-chk-size
EXTRA_LIBS=@LIBS@ @EXTRA_LIBS@ @OPENSSL_LIBS@
LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS} -ldl -lpthread -lutil
LOCAL_LDFLAGS=-rdynamic -ggdb -levent ${EXTRA_LIBS} -lpthread -lutil
LINK_FLAGS=${LDFLAGS} ${LOCAL_LDFLAGS}

ifneq (${TARGET_OS}, FreeBSD)
LOCAL_LDFLAGS += -ldl
endif

DEP=dep
AUTO=auto
EXE=bin
Expand All @@ -23,6 +28,10 @@ TG_OBJECTS=${OBJ}/main.o ${OBJ}/loop.o ${OBJ}/interface.o ${OBJ}/lua-tg.o ${OBJ}
INCLUDE=-I. -I${srcdir} -I${srcdir}/tgl
CC=@CC@

PREFIX?=/usr/local
INSTALL_BIN=$(PREFIX)/bin
INSTALL=install

.SUFFIXES:

.SUFFIXES: .c .h .o
Expand Down Expand Up @@ -56,3 +65,7 @@ clean:
distclean:
rm -rf ${DIR_LIST} config.h config.log config.status

install: all
@mkdir -p $(DESTDIR)/$(INSTALL_BIN)
$(INSTALL) bin/telegram-cli $(DESTDIR)/$(INSTALL_BIN)
rm -rf ${DIR_LIST} config.log config.status > /dev/null || echo "all clean"
4 changes: 3 additions & 1 deletion Makefile.tgl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ GENERATE_OBJECTS=${OBJ}/generate.o
TGL_COMMON_OBJECTS=${OBJ}/tools.o ${OBJ}/crypto/rand_openssl.o ${OBJ}/crypto/rand_altern.o ${OBJ}/crypto/err_openssl.o ${OBJ}/crypto/err_altern.o
TGL_OBJ_C=${GENERATE_OBJECTS} ${TGL_COMMON_OBJECTS} ${TGL_OBJECTS} ${TLD_OBJECTS}

AR?=ar

.SUFFIXES:

.SUFFIXES: .c .h .o
Expand All @@ -26,7 +28,7 @@ ${TGL_OBJECTS_AUTO}: ${OBJ}/auto/%.o: ${AUTO}/%.c | create_dirs
# ${CC} ${INCLUDE} ${COMPILE_FLAGS} -iquote ${srcdir}/tgl -c -MP -MD -MF ${DEP}/auto/auto.d -MQ ${OBJ}/auto/auto.o -o $@ $<

${LIB}/libtgl.a: ${TGL_OBJECTS} ${TGL_COMMON_OBJECTS} ${TGL_OBJECTS_AUTO}
rm -f $@ && ar ruv $@ $^
rm -f $@ && ${AR} ruv $@ $^

${EXE}/generate: ${GENERATE_OBJECTS} ${TGL_COMMON_OBJECTS}
${CC} ${GENERATE_OBJECTS} ${TGL_COMMON_OBJECTS} ${LINK_FLAGS} -o $@
Expand Down
133 changes: 76 additions & 57 deletions README-Cygwin.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,76 @@
### Installation on Windows
To use telegram-cli in Windows, you should compile with Cygwin which has POSIX API functionality.

Install [Cygwin](https://www.cygwin.com/) and cygwin's package manager, [apt-cyg](https://github.com/transcode-open/apt-cyg).

In Cygwin Terminal, install compiler and tools :

apt-cyg install cygwin32-gcc-core cygwin32-gcc-g++ gcc-core gcc-g++ make wget patch diffutils grep tar gzip

Now you have a compiler, but no libraries. You need readline, openssl, libconfig, liblua, python and libjansson to use telegram-cli's full functionality.


Then Clone GitHub Repository in Cygwin Terminal

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


In Cygwin Terminal, type:

apt-cyg install libevent-devel openssl-devel libreadline-devel lua-devel python3
(Install package 'python' to use Python 2.7, or install package 'python3' to use Python 3)

libconfig and libjansson is not in cygwin's package, so you should compile yourself.

Compile libconfig

wget http://www.hyperrealm.com/libconfig/libconfig-1.5.tar.gz
tar xvf libconfig-1.5.tar.gz && cd libconfig-1.5
./configure
make && make install && cd ..

Compile libjansson

wget http://www.digip.org/jansson/releases/jansson-2.7.tar.gz
tar xvf jansson-2.7.tar.gz && cd jansson-2.7
./configure
make && make install && cd ..

Then, go to tg directory then generate Makefile.

cd tg
./configure

We need to patch Makefile and loop.c to compile in cygwin. Download this [patch](https://gist.github.com/ied206/d774a445f36004d263ab) then untar. Then, patch in tg directory.

patch -p1 < telegram-cli-cygwin.patch

Then
make

After compile is done, **telegram-cli.exe** will be generated in **bin** directory.

To run telegram-cli, type

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

**Caution**: A binary compiled with Cygwin should be run in Cygwin Terminal.
### Installation on Windows
To use telegram-cli in Windows, you should compile with Cygwin which has POSIX API functionality.

Install [Cygwin](https://www.cygwin.com/).

In Cygwin Terminal, install cygwin's package manager, apt-cyg, as per apt-cyg's [project page](https://github.com/transcode-open/apt-cyg):

lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg
install apt-cyg /bin

Then install compiler and tools: if you're on the **32-bit** version of cygwin,

apt-cyg install gcc-core gcc-g++ gcc-core gcc-g++ make wget patch diffutils grep tar gzip autoconf automake libtool git zlib-devel

Whereas on the **64-bit** version,

apt-cyg install cygwin32-gcc-core cygwin32-gcc-g++ gcc-core gcc-g++ make wget patch diffutils grep tar gzip zlib-devel

You need libraries *readline*, *openssl*, *libconfig*, *liblua*, *python* and *libjansson* to use telegram-cli's full functionality.

Clone this project's GitHub Repository in Cygwin Terminal

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

Then type:

apt-cyg install libevent-devel openssl-devel libreadline-devel lua-devel python3

(Install package 'python' to use Python 2.7, or install package 'python3' to use Python 3)

libconfig and libjansson are not included in the cygwin package, so you should compile them yourself.

Compile libconfig:

wget https://github.com/hyperrealm/libconfig/archive/v1.7.2.tar.gz
mv v1.7.2.tar.gz libconfig-1.7.2.tar.gz
tar xvf libconfig-1.7.2.tar.gz && cd libconfig-1.7.2
autoreconf
./configure
make && make install && cd ..

Compile libjansson:

wget http://www.digip.org/jansson/releases/jansson-2.7.tar.gz
tar xvf jansson-2.7.tar.gz && cd jansson-2.7
./configure
make && make install && cd ..

Then, change to the tg directory and generate the Makefile.

cd tg
./configure

In case `configure` fails, it might be because of the CRLF line endings, so:

dos2unix -f configure

And again,

./configure

We need to patch the Makefile and loop.c to compile properly in cygwin. The patch is included, so just type:

patch -p1 < telegram-cli-cygwin.patch

Then,

make

Once the compilation is complete, **telegram-cli.exe** will be found in the **bin** subdirectory.

To run `telegram-cli`, type

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

**Caution**: A binary compiled with Cygwin should be run in Cygwin Terminal.
1 change: 1 addition & 0 deletions README-LUA
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ It should have several functions:
on_our_id(our_id) - Informs about id of currently logged in user.

on_msg_receive(msg) - it is called when we receive new msg (!! may be called before on_binlog_replay_end, than it is old msg).
on_msg_history(msg) - it is called when a msg from history is printed.

on_user_update(user,what_changed) - updated info about user. what_changed is array of strings.
on_chat_update(user,what_changed) - updated info about user. what_changed is array of strings.
Expand Down
16 changes: 9 additions & 7 deletions README-PY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ Assign python fuctions to the following tgl attributes to set callbacks from TG.
|`tgl.on_get_difference_end()`| This is called after first get_difference call. So we received all updates after last client execute.|
|`tgl.on_our_id(our_id)`|Informs about id of currently logged in user.|
|`tgl.on_msg_receive(msg)`| This is called when we receive new `tgl.Msg` object (*may be called before on_binlog_replay_end, than it is old msg*).|
|`tgl.on_msg_history(msg)`| This is called when we receive a `tgl.Msg` object from a history printing.|
|`tgl.on_user_update(peer, what_changed)`|updated info about user. peer is a `tgl.Peer` object representing the user, and what_changed is array of strings.|
|`tgl.on_chat_update(peer, what_changed)`|updated info about chat. peer is a `tgl.Peer` object representing the chat, and what_changed is array of strings.|
|`tgl.on_secret_chat_update(peer, what_changed)`|updated info about secret chat. peer is a `tgl.Peer` object representing the secret chat, and what_changed is array of strings.|
|`tgl.on_loop()` | This is called every now and then.|

Python Callback Signatures
=========================
Expand All @@ -32,7 +34,7 @@ As mentioned, all methods and functions have callbacks. The following are the di
|----- | ------------------ | ------------|
|empty_cb|`(success)`|This just indicated the success of the call. All other callback types have this as well.|
|contact_list_cb|`(success, peer_list)`|`peer_list` is a list of `tgl.Peer` objects|
|dialog_list_cb|`(success, dialog_list)`|`dialog_list` is a list of dicts, with keys: 'peer': `tgl.Peer`, 'message': `tgl.Msg`|
|dialog_list_cb|`(success, dialog_list)`|`dialog_list` is a list of dicts, with keys: 'peer': `tgl.Peer`, 'unread': `bool( Determine whether has unread message)`|
|msg_cb|`(success, msg)`|`msg` is a `tgl.Msg`|
|msg_list_cb|`(success, msg_list)`|`msg_list` is a list of `tgl.Msg` objects|
|file_cb|`(success, file_path)`|`file_path` is a string with an absolute path|
Expand All @@ -57,6 +59,7 @@ All of these functions are accessed by importing the `tgl` module.
|`tgl.set_profile_photo (file_path)`|Sets avatar to image found at `file_path`, no checking on the file.|`empty_cb`|
|`tgl.create_secret_chat (user)`|Creates secret chat with user, callback recommended to get new peer for the secret chat.|`secret_chat_cb`|
|`tgl.create_group_chat (peer_list, name)`|`peer_list` contains users to create group with, must be more than 1 peer.|`empty_cb`|
|`tgl.delete_msg (msg_id)`|Deletes the message from the local history.|`empty_cb`|
|`tgl.restore_msg (msg_id)`|Restore a deleted message by message id.|`empty_cb`|
|`tgl.status_online ()`|Sets status as online|`empty_cb`|
|`tgl.status_offline ()`|Sets status as offline|`empty_cb`|
Expand Down Expand Up @@ -100,20 +103,20 @@ Peer
|`peer.chat_del_user (user)`|Removes `user`(`tgl.Peer`) from the group. The calling peer must be of type `tgl.PEER_CHAT`|`empty_cb`|
|`peer.mark_read ()`|Marks the dialog with the peer as read. This cannot be done on message level.|`empty_cb`|
|`peer.msg_search (text, callback)`|Get all messages that match the search text with the peer. *requires callback*|`msg_list_cb`|
|`peer.get_history (offset, limit, callback)`|Get all messages with the peer. `offset` specifies what message to start at, and `limit` specifies how many messages to retrieve. See example below for one method to get the entire history. *requires callback*|`msg_list_cb`|
|`peer.history (offset, limit, callback)`|Get all messages with the peer. `offset` specifies what message to start at, and `limit` specifies how many messages to retrieve. See example below for one method to get the entire history. *requires callback*|`msg_list_cb`|
|`peer.info ()`|Gets peer info.|`peer_cb`|

Example usage for `peer.get_history`:
Example usage for `peer.history`:
```
from functools import partial
history = []
# Get all the history, 100 msgs at a time
peer.get_history(0, 100, partial(history_callback, 100, peer))
peer.history(0, 100, partial(history_callback, 100, peer))

def history_callback(msg_count, peer, success, msgs)
def history_callback(msg_count, peer, success, msgs):
history.extend(msgs)
if len(msgs) == msg_count:
peer.get_history(len(history), msg_count, partial(history_callback, msg_count, peer))
peer.history(len(history), msg_count, partial(history_callback, msg_count, peer))
```

Msg
Expand Down Expand Up @@ -172,4 +175,3 @@ Msg
|`msg.load_audio(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.load_document(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.load_document_thumb(callback)`|Saves the media and returns the path to the file in the callback. *requires callback*|`file_cb`|
|`msg.delete_msg ()`|Deletes the message from the local history|`empty_cb`|
6 changes: 3 additions & 3 deletions README.es
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Telegram messenger CLI [![Build Status](https://travis-ci.org/vysheng/tg.png)](https://travis-ci.org/vysheng/tg)
## Telegram messenger CLI [![Build Status](https://travis-ci.org/kenorb-contrig/tg.png)](https://travis-ci.org/kenorb-contrig/tg)

!!!! May be outdated. Please refer to english README as more actual.

Expand All @@ -15,11 +15,11 @@ La documentación del protocolo MTproto está disponible aquí: http://core.tele

Clona el Repositorio GitHub

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

o descarga y descomprime el zip

$ wget https://github.com/vysheng/tg/archive/master.zip -O tg-master.zip
$ wget https://github.com/kenorb-contrig/tg/archive/master.zip -O tg-master.zip
$ unzip tg-master.zip && cd tg-master

#### Linux
Expand Down
Loading