Short: Unofficial native Telegram chat client Uploader: michele.dipace@kaffeine.net (Michele Dipace) Author: Michele Dipace Type: comm/tcp Version: 0.0.97 Replaces: comm/tcp/TelegramAmiga-MOS.lha Architecture: ppc-morphos Requires: MorphOS 3.x with its TCP/IP stack WHAT IS THIS? ------------- Unofficial Telegram Amiga: it uses the Telegram API and is part of the Telegram ecosystem, but it is not made by Telegram. Telegram Amiga brings real, live Telegram chat to the Amiga -- not through a gateway, a proxy service or a web wrapper, but by speaking Telegram's own MTProto protocol natively, from scratch, on your machine. You sign in to your normal Telegram account, your chat list appears, and you talk to people (and they talk back) on hardware that may well be older than they are. Everything is built in: RSA, Diffie-Hellman, AES, SHA and the SRP two- factor login are implemented inside the program. Zero external dependencies -- no MUI, no ixemul.library, no AmiSSL, no TCP helper beyond your system's own bsdsocket stack. One program, two faces, one engine and one saved login: TelegramAmiga - the native Intuition/GadTools GUI: chat list with real profile-picture avatars, message bubbles, scrollbars, mouse wheel, context menus. This package ships its icon. The same binary also runs a full-screen text/console client from a Shell -- the manual gives the command line. WHAT CAN I ACTUALLY DO WITH IT? ------------------------------- Read and send messages in private chats, groups and channels. Download a received file (right-click -> Download) or send one from disk, up to 250 MiB on this build, including files over 10 MiB. Photos appear immediately as blurred previews, refine from a bounded download and reuse decoded pixels from disk when reopened. Click one for a larger progressive viewer, or disable inline loading on a slower machine and open only the images you choose. Forward one message to Saved Messages in a click, or choose another destination through chat search. Use the pinned Saved Messages chat as a cloud transfer drawer between the Amiga and your phone or PC. Reply to a specific message (right-click it). Edit or delete your own messages. See real delivery state: one tick = sent, two blue ticks = read, updating live. See who is typing. Search for chats. Send messages from your desk at work and find the conversation already synced when you get home to the Amiga -- and the other way round. Message times follow your Amiga clock. Unread badges and your chat order survive restarts. The window remembers where you left it, and can open on its own screen if you prefer a dedicated page for chatting. GETTING STARTED --------------- 1. Copy this drawer to a WRITABLE volume (not from the archive directly). 2. Double-click TelegramAmiga (or TelegramAmiga-TUI on very low-end setups). 3. First run walks you through the normal Telegram login: phone number, the code Telegram sends you, and your cloud password if you use two-factor. That is all -- next time it goes straight to your chats. The login is stored in telegram-auth.bin next to the program. Treat that file like a house key: NEVER copy it around or share it -- anyone who has it has your Telegram session. Full EN and IT manuals are in the archive, including per-platform notes and troubleshooting. WHAT IS NEW IN 0.0.97 --------------------- ADDED - Service messages show in the chat, centred on a pill as the official clients draw them: "Anna added Marco", "Marco left the group", "You pinned a message", a new group name or photo, calls with their length, video chats, the auto-delete timer, "Marco joined Telegram". An action the client has no words for reads "Service message". A chat whose only message was one of these, such as a new contact's "joined Telegram", opened empty, and in groups they were skipped without a trace. The text client prints them as "* Anna added Marco". They do not notify. - New messages tell you when you are elsewhere, without taking the focus from whoever is typing. The window title counts what came in the other chats, "Unofficial Telegram Amiga (3 new)", and the count goes when the chat is opened. A pop-up of our own, the same on every system with nothing to install, shows the chat and the count, or the start of the message if you want it, in the top right corner of the screen for ten seconds, drawn like an incoming bubble of the chat: flat dark grey with rounded corners, the chat's name in a light shade of its own colour, the text in white, in a font sized to the screen: a quarter above the screen's font, more on a tall screen (20 points at 1080 lines). A click on it opens that chat and brings the window forward. An optional beep, a short chime of its own through AHI or the Amiga's own sound chip, plays once per run of news; only where neither opens does the screen flash instead, since a 16- or 24-bit screen shows no flash and stayed silent. Iconified, the client keeps reading the network: the AppIcon's label counts the news, "TelegramAmiga (3)", the pop-up shows on the Workbench, and a double-click opens the window on the chat with them. With the window behind or iconified the open chat counts as well. Settings > New messages: Off, Count in title, Count and pop-up, Pop-up with the text, and Beep. Pop-up with the text is the default on machines that draw it at ease, Count in title on a classic Amiga below the 68040 or without a graphics card, as with photos and avatars; a choice made in the menu is kept from then on. Off leaves the iconified client asleep, as before. - The text client shows its chats as tabs on the line under the top one, the bar the plain-68000 user sketched after the IRC clients of old: "F1 Mario | F2 AmigaIta | F3 ...", as many as the window is wide, each one always in its place, the open chat in brackets and highlighted, a star on a chat with new messages until you open it. F1 to F10 already changed chat; now they show which is which, and they also answer the first "Chat number" question. /move 5 1 makes chat 5 number 1, the one F1 opens, so the chats you use most sit under the first keys; the window keeps the same order. On a narrow window, such as a console on a 320-pixel screen, the tabs go compact, "1 Tele 2 Amig 3 Amic", four where two fitted, with the open chat's whole name in the top line. The Help key shows the command list, and the line above the text reminds how to send a file. A window under 12 rows keeps that line for the messages. FIXED - An emoji in a name reads as its text emoticon wherever the window's own painter does not draw it: in the new-message pop-up, in the "Remove chat" question and in the title of the photo viewer. The window keeps an emoji it can draw as two bytes of its own, and these places wrote the bytes as they were, so the font showed a box and a stray sign: a group name ending in a grinning face ended in a box and a "&" in the pop-up on a Raspberry Pi 400. It now ends in ":D", as on the clipboard. - Ctrl-C with the window open, typed in the Shell that started the client or sent with Break from another Shell, quits as Amiga+Q does: the window closes and the program ends cleanly. The C library caught the break first, at the next write to a file or to the Shell, printed "*** BREAK" and ended the program there, leaving the window on the screen with no program behind it, where a click could bring the system down. On AROS, whose C library does not watch for Ctrl-C, the window ignored it. A network wait stuck on a dead link gives way to it too. - A message you send shows its time as soon as the next update comes in. Its bubble stayed without a time until the chat was opened again: the bubble takes its number from the send itself, so when the update brought the message back with its time, the window took it for a copy already on screen and dropped it, time included. - In Saved Messages what you wrote stands on the right, as yours. Telegram returns that history without the outgoing mark on what your account wrote there from another session or device, so after a reload those messages looked received, grey and on the left, while the one just sent stood on the right. As the official clients do, every message there is now yours unless it was forwarded in, which keeps the look of where it came from. - While the chat list shows search results, the header keeps the picture of the chat open below. It showed the picture of the row the arrow was on, next to the name of the open chat. - On a screen with few colours, such as a 4-colour Workbench, the arrow-key focus in the chat list shows: the row is framed. Its tint got the background's own colour there, so nothing marked where ENTER would land. - The chat list shows the real picture of chats you have not opened. Only an open chat fetched its picture, so the others kept the blurred preview Telegram sends with the list. In quiet moments the window now fetches one every few seconds, the most recent chats first. A picture kept on a datacenter the window has not talked to yet still waits for its chat to be opened, as that first contact costs a key exchange. Nothing changes where avatars are off (Settings > Show avatars), as on slow machines by default. Seen in the AROS x86_64 VM: within a minute and a half most of the list had its pictures. - Inline photos no longer slow every redraw on a screen of 256 colours or fewer, such as a stock A1200's. Each repaint drew every photo again with one fill for every run of equal colour, tens of thousands for one photo; now the photo is drawn once into a picture in the screen's own format and copied with the blitter from then on, drawn again only when it gets sharper, changes size or the screen changes. On an emulated stock A1200 (14 MHz 68EC020, 640x512 in 32 colours) a redraw of a chat with one photo in view went from 2.7-3.0 seconds to 0.45; the copy takes about a quarter of a second to make when the photo appears. Screens with more colours write photos in true colour and are unchanged. - The login says what went wrong in plain words, with what to do under the field: "That number is not valid" over "Type it with the country code, e.g. +39 3331234567", "Too many attempts" over "Telegram asks to wait 5 minutes", "Could not reach Telegram" over "Check the network connection and try again". It showed Telegram's own error line instead, cut to the width of the status: a user who typed the number without its country code saw only "...auth.sendCode: rpc-error 40". An expired code no longer reads as a wrong one: the window goes back to the number, already typed, so ENTER asks for a new code, and the text client asks for it by itself. - A chat holding an unsent draft, typed here or on another device, no longer hides itself and the chats below it. Telegram sends the drafts with the chat list, and a draft the client could not read stopped the list at that chat: the chats below kept old unread counts, a new chat there did not appear, and in an open chat with a draft your messages could miss their second tick. Plain drafts are now read through, and a draft with formatting, a reply or a photo is stepped over to the next chat. - In supergroups and channels the second tick also comes from Telegram's live notice, as in private chats, instead of only from the next check a few seconds later. - A new message in another chat that arrives bundled with other updates marks its chat at once. When another update came first in the bundle, it waited for the periodic catch-up, a minute or more. - On AmigaOS 3 the keys typed at the first login feed the random numbers of the new session key with their real timing. Until the first random number was drawn the timer was not open, and they were timed to the second. - On AROS a connection to a server that does not answer gives up after the same time as on the other systems and can be interrupted; it could hang for a long time. A connection refused at once, as with the network down, still fails at once. Network errors there say what happened, such as "Connection refused", or "socket connect stopped" after Ctrl-C, instead of "No error" or "No such file or directory". - On MorphOS inline photos no longer flash when the window redraws, as when a photo you just sent sharpens in steps. The window is drawn off screen and copied in one go, but there the off-screen frame was not in the graphics card's own format, so the photos were painted on the window after the copy and their place showed empty for a moment at every full redraw. The frame now has the card's format and the photos go into it. - Cyrillic and Greek are spelled out in Latin letters, "Privet" and "Ellada", instead of a question mark per letter in the text client and nothing at all in the window. In the text client a word in an alphabet with no such spelling here, such as Hebrew or Chinese, shows a single "?", and a text with nothing readable at all says "(another alphabet)". CHANGED - The text client is simpler to live with, as the plain-68000 user asked. It starts with three lines of help instead of the whole command list, and /help puts the everyday commands first. The prompt names the chat you write to, "[Mario] >", and your own lines read "You:": your account's name stood in both places, and a name written in emoji came out as ":/ ?". A group member the client cannot name reads "someone" instead of "?". Messages from groups that are not in your chat list, from someone not in it either, no longer scroll past one nameless line each: the top line counts them, "(+3 elsewhere)", until /list, and only chats you know make the screen flash. /list and /chats show your chats as /peers does, and the first question asks for a "Chat number". - Less memory: the 68000 text client needs 1.32 MB to load instead of 1.53, and the AmigaOS 3 window build about 500 KB less, by sharing buffers that are never in use at the same time. - The key exchange at the first login and the two-step password check take about 17% fewer big-number multiplications (about 2560 instead of 3072 for each 2048-bit power). - telegram-auth.bin is written only when Telegram changes the session's salt, no longer after every request. - The 68000 build leaves out the old Bot API commands, which need HTTPS that build does not have; asking for one says so. - The "Send photo" window opens centred over the main window and takes the focus only after its first drawing; the blinking cursor of the login screen redraws only its field. A COMMUNITY PROJECT ------------------- MIT licensed, non-commercial, written for the love of the platform. Bug reports and wishes are very welcome -- testers on real hardware (A1200s, A4000s, Pegasos, Sam, FPGA machines) are what moves this project forward. The icon is our own design. Carlo Spadoni optimised it for each system, put it on a standard drawer for the drawer icon, and let me ship his versions. Source + issues: https://github.com/kaffeine1/telegram-amiga Development diary: https://androidlab.it/en/telegram-amiga-mtproto-client-development-diary/