Files
mcde/programs/dtchat/Makefile.am
T
lotherk 790669d989 dtchat: download accepted Telegram documents (T8.1)
An incoming messageDocument is remembered with its TDLib file id; file-accept sends downloadFile (priority 1, whole file) and updateFile is followed until local.is_downloading_completed, then the local file is read in 4 KiB blocks and sent as file-data with a file-end carrying the SHA-256 computed with dc_file_sha256. Unknown offers answer file-error. The fake mode can offer a real local file through DTCHAT_TELEGRAM_FAKE_FILE and exercises the same read/hash/chunk/event path; tests/telegram_fake.py now uses a 9000-byte file, checks the offer size and SHA-256, reassembles the chunks byte-for-byte and verifies the file-end hash (25 checks, green stand-alone). The adapter links CRYPTOLIB for EVP/dc_file_sha256. The TDLib downloadFile/updateFile branch is compiled but not exercised without an account. Full build and harness follow.
2026-11-17 12:12:44 +00:00

79 lines
2.9 KiB
Makefile

MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dtchat dtchat-headless dtchat-irc
noinst_PROGRAMS = dtchat-demo
man_MANS = dtchat.1
dtchat_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libDtChat -I$(top_builddir)/lib/libDtChat \
-DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\"
# The model and the JSON schema helpers live in libDtChat/libDtChatIpc;
# DtInitialize/DTCLIENTLIBS come with T2.7.
dtchat_LDADD = $(top_builddir)/lib/libDtChat/libDtChat.la \
$(top_builddir)/lib/libDtChat/libDtChatIpc.la \
$(top_builddir)/lib/McdeSys/libMcdeSys.la $(XTOOLLIB)
dtchat_SOURCES = main.c ui_main.c ui_accounts.c ui_request.c ui_peer.c \
ui_file.c localui.c ui_call.c demo.c accounts_run.c ui_main.h \
ui_accounts.h ui_request.h ui_peer.h ui_file.h localui.h ui_call.h \
demo.h accounts_run.h
dtchat_demo_SOURCES = demo_adapter.c
dtchat_demo_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libDtChat -I$(top_builddir)/lib/libDtChat
dtchat_demo_LDADD = $(top_builddir)/lib/libDtChat/libDtChatIpc.la
dtchat_irc_SOURCES = irc_adapter.c
dtchat_irc_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libDtChat -I$(top_builddir)/lib/libDtChat \
$(TLS_CPPFLAGS)
dtchat_irc_LDADD = $(top_builddir)/lib/libDtChat/libDtChat.la \
$(top_builddir)/lib/libDtChat/libDtChatIpc.la $(LIBTLS)
dtchat_headless_SOURCES = headless.c
dtchat_headless_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libDtChat -I$(top_builddir)/lib/libDtChat
dtchat_headless_LDADD = $(top_builddir)/lib/libDtChat/libDtChat.la \
$(top_builddir)/lib/libDtChat/libDtChatIpc.la $(LIBTLS) $(CRYPTOLIB)
noinst_PROGRAMS += dtchat-telegram
dtchat_telegram_SOURCES = telegram_adapter.c
dtchat_telegram_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libDtChat -I$(top_builddir)/lib/libDtChat \
$(TDLIB_CPPFLAGS)
dtchat_telegram_LDADD = $(top_builddir)/lib/libDtChat/libDtChat.la \
$(top_builddir)/lib/libDtChat/libDtChatIpc.la $(TDLIBLIB) \
$(CRYPTOLIB)
if MCDE_GO
# whatsmeow is a Go library, so the WhatsApp adapter is a Go program built
# next to the others (no automake program: the sources are Go, not C).
all-local: dtchat-whatsapp
dtchat-whatsapp: $(srcdir)/whatsapp_adapter/main.go \
$(srcdir)/whatsapp_adapter/go.mod $(srcdir)/whatsapp_adapter/go.sum
cd $(srcdir)/whatsapp_adapter && \
GOFLAGS=-mod=mod GOSUMDB=off GOPROXY=off $(GO) build -o "$(abs_builddir)/dtchat-whatsapp" .
clean-local:
rm -f dtchat-whatsapp
endif
if MCDE_STROPHE
noinst_PROGRAMS += dtchat-xmpp
dtchat_xmpp_SOURCES = xmpp_adapter.c
dtchat_xmpp_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libDtChat -I$(top_builddir)/lib/libDtChat
dtchat_xmpp_LDADD = $(top_builddir)/lib/libDtChat/libDtChat.la \
$(top_builddir)/lib/libDtChat/libDtChatIpc.la $(STROPHELIB) \
$(CRYPTOLIB)
endif
appdefaultsdir = $(CDE_INSTALLATION_TOP)/app-defaults/C
dist_appdefaults_DATA = Dtchat
if SOLARIS
dtchat_LDADD += -lintl
endif