Coder Social home page Coder Social logo

ubports / telegram-app Goto Github PK

View Code? Open in Web Editor NEW
55.0 14.0 23.0 58.76 MB

Unofficial Telegram App for Ubuntu Desktop & Mobile

License: GNU General Public License v3.0

Shell 1.35% QMake 1.77% Java 3.04% C++ 42.41% C 0.22% QML 42.25% Csound Score 0.95% JavaScript 0.90% Lua 0.23% Python 6.15% Prolog 0.72%
core-app telegram

telegram-app's Introduction

Telegram for Ubuntu Touch

TL;DR

"clickable" for a full mobile build[1]
"./setup.sh -t desktop -db" for a full desktop build

This build setup has been tested on: - Ubuntu Vivid 15.04 with Overlay PPA enabled - Ubuntu Xenial 16.04

The following instructions assume you downloaded Telegram for Ubuntu source and changed ("cd") to the project's root directory.

How to build

  1. Install build dependencies.

case Device:

If you don't have a 15.04 click chroot yet:

    $ sudo click chroot --arch armhf --framework ubuntu-sdk-15.04 create

To install the build dependencies in the chroot:

    $ sudo click chroot --arch armhf --framework ubuntu-sdk-15.04 maint
    $ apt-get install libthumbnailer-qt-dev:armhf

case Desktop:

Install the build dependencies using the following command:

    $ sudo apt-get install intltool ubuntu-sdk-ide ubuntu-sdk-libs ubuntu-sdk-qmake-extras
    $ sudo apt-get install libthumbnailer-qt-dev libunity-scopes-dev qtdeclarative5-dev qtmultimedia5-dev 
    $ sudo apt-get install qml-module-ubuntu-connectivity qtcreator-plugin-ubuntu qtdeclarative5-ubuntu-contacts0.1
  1. Environment setup

case Device:

Change your directory into below:

    $ cd ~/.config/QtProject/qtcreator/ubuntu-sdk/ubuntu-sdk-15.04-armhf

then make a symbolic link bewteen qtc_chroot_wrapper and the make:

    $ ln -s /usr/share/qtcreator/ubuntu/scripts/qtc_chroot_wrapper.py make

then make a symbolic link bewteen qtc_chroot_wrapper and qmake:

    $ ln -s /usr/share/qtcreator/ubuntu/scripts/qtc_chroot_wrapper.py qt5-qmake-arm-linux-gnueabihf
  1. Download and build the source of libqtelegram-aseman-edition library and TelegramQML plugin:

    $ ./setup.sh -t <build_type> -d
    

    The help command will show the available values for <build_type>. It'll git clone both projects to the deps directory and build them (inside the click chroot, if the build type chosen was "mobile"). You can use same command to re-build, if you have changed them, too.

    NOTE: it may be required to modify some environment variables that drive the build process, such as the path to qmake or make, the path to system libraries, the name of the chroot, etc. The env variables are grouped at the beginning of setup.sh, to make the customization easier.

  2. Build Telegram for Ubuntu Touch

    $ ./setup.sh -t <build_type> -b
    

    This will build the app in the build path defined by setup.sh and prepare everything in a directory named click in the project's root directory. NOTE: it may be required to modify some environment variables that drive the build process, such as the path to qmake or make, the path to system libraries, the name of the chroot, etc. The env variables are grouped at the beginning of setup.sh, to make the customization easier.

  3. (Optional) Build the click package and install it using adb (requires an Ubuntu Touch mobile device connected via USB with developer mode enabled):

    $ ./setup.sh -t mobile -c
    

How to run (DESKTOP VERSION only)

$ cd build_desktop/lib/x86_64-linux-gnu/bin/
$ LD_LIBRARY_PATH=../../../:$LD_LIBRARY_PATH ./telegram

(Optional for Unity7) To be able to send messages, run indicator-network-service, or edit AccountSendMessage.qml as suggested in this README.

How to delete the build files

$ ./setup -t <build_type> -e

How to get help

$ ./setup -h

Autopilot

Install On Desktop

To install Autopilot on a Ubuntu Desktop follow this tutorial.

Install on Device

To install on a Ubuntu device you will need to first connect to the device via SSH:

$ adb shell

Then execute the following commands:

$ sudo mount -o remount,rw /

$ sudo apt-get update

$ sudo apt-get install python3-autopilot ubuntu-ui-toolkit-autopilot -yq

Telegram-App code changes

Download the following telegram-app sample project which contains the autopilot test cases and and supporting documentation such as, Telegram-App_Code_Changes.pdf:

$ bzr branch lp:~cellsoftware/telegram-app/autopilotTest-3

Telegram-App_Code_Changes.pdf lists the components which need to be updated, on your on version of the telegram-app code, with the objectName attribute in order for them to become visible to autopilot. This document also describes certain code changes which need to be made in order for desktop tests to pass. These are mainly to do with simulating an online device.

Once downloaded, you will have created and autopilotTest-3 directory on your computer. The autopilot test scripts for telegram-app can be found in the following relative directory path:

autopilotTest-3/telegram/autopilot/telegram

This directory structure must be maintained when copying the autopilot test cases to your own version of the app.

##Test Environment

###Telegram-CLI All tests involving the sending and receiving of messages will involve the Telegram CLI. This can be downloaded from GitHub. Follow the instructions to install and build. The Telegram CLI scripts are written in Lua and can be found in the following relative directory path:

autopilotTest-3/telegram/autopilot/CLI

This directory structure must be maintained when copying the autopilot test cases to your own version of the app.

Telegram CLI Launch

Once downloaded cd, to the 'tg' folder. Then execute the following command:

$ bin/telegram-cli -k tg-server.pub -W -s <location of the test script>

###Test Data The following are prerequisites to executing the autopilot test cases:

  • A Telegram user must be logged into the app
  • The Telegram user must be signed into their Ubuntu One account
  • The app must not be launched
  • The device must not be screen or SIM locked
  • The device must be on the screen displaying the apps
  • The user must have 2 Telegram contacts defined, one of which must be the phone number used to set up the Telegram CLI
  • The Telegram CLI must be online
  • The status of the first contact must be online during all the tests execution
  • There shouldn't be a conversation with the first contact or, in case there is, that should be empty
  • Ideally, there shouldn't be any conversation (conversations list empty). If that's not possible, it would be nice having the less possible
  • Device where testing must be in English
  • Camera app must be allowed to be used from Telegram app before starting the tests.

Execution

Desktop

Before running, the telegram-app and its dependencies have to be built. From the autopilotTest-3 directory execute the following command:

$ ./setup.sh -t desktop -db

To execute the entire test suite perform the following command from the autopilotTest-3/telegram/autopilot/ directory:

$ autopilot3 run telegram/

To get a list of all individual test cases execute the following command:

$ autopilot3 list telegram/

You will see an output similar to this:

*2 telegram.tests.test_Messaging.SecretMessaging.test_SecretMessage telegram.tests.test_Profile.ProfileTests.test_check_group_to_verify_members telegram.tests.test_Profile.ProfileDetails.test_verify_profile_details telegram.tests.test_Profile.ProfileTests.test_check_blocked_user

The *2 next to a test case refers to the number of scenarios within that test case. Therefore executing test_SecretMessage will run the same Secret Message test case but for 2 scenarios, e.g. sending a Secret Message containing text only and sending a Secret Message containing images only.

To execute all Profile tests execute the following:

$ autopilot3 run telegram.tests.test_Profile

To execute all Profile Detail tests, execute the following:

$ autopilot3 run  telegram.tests.test_Profile.ProfileDetails

To execute individual tests choose a test from the list, for example telegram.tests.test_Login.Login.test_sign_in then execute the following command:

$ autopilot3 run telegram.tests.test_Login.Login.test_sign_in

Device

To execute the autopilot test cases on a device, the telegram-app, its dependencies and the click package have to be built and installed on the device. Once you have connected your device via USB, build the mobile version of the app using the following command:

$ ./setup.sh -t mobile -dbcu

Next, navigate to the installed test suite using:

$ adb shell

$ cd /opt/click.ubuntu.com/com.ubuntu.telegram/current/autopilot

The listing and executing of tests are as described in the Desktop section.

Notes

After getting Autopilot working. Here are some notes you need to do to ensure tests can be run properly:

Device

During device testing the orientation should remain as portrait. Changing the orientation to landscape will cause tests to fail.

Telegram CLI

If any of the test cases executed require the sending and/or receiving of messages the Telegram CLI will have to be launched, as described above. If left running for some time without activity the Telegram CLI will go offline. This may cause some autopilot tests to fail. To bring the Telegram CLI back online you can issue a CLI command, or quit the CLI by entering 'safe_quit' and relaunching.

Flags

Here are the types and meanings for each flag:

-d - Dependency - Build the dependency to support the app -b - Build - Builds and compile the app. -c - Install on device -u - Adds the autopilot tests to the click package installed on the device

$ ./setup.sh -t mobile -<flag(s)>

For a more in-depth 'how-to' see here.

References & Tutorials

telegram-app's People

Contributors

adrmzz avatar advocatux avatar ahmedsuliman92 avatar alexanderisme avatar andrzejstamburski avatar cibersheep avatar dark-eye avatar dfiloni avatar docash59 avatar dohxis avatar ebeton-ro avatar faenil avatar flohack74 avatar gabriele69 avatar ivoxavier avatar jeffi007 avatar lindisfritjof avatar louies0623 avatar mk1973 avatar mymike00 avatar nfsprodriver avatar pablochere avatar pacomolinero avatar pazchauhan avatar rpadovani avatar t-h-e-p-e-t-e-r avatar therealdonhammer avatar tomrausner avatar tronfortytwo avatar weblate 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

Watchers

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

telegram-app's Issues

Change notification icons faster

From @ChloeWolfieGirl on July 3, 2017 19:40

If someone changes there Profile picture on telegram, often the notifications will continue to use an old profile picture.
I don't know if this affects other apps.

Copied from original issue: ubports/ubuntu-touch#145

Refactor critical portions of code

Scrolling the messages in a conversation page is pretty stressful: frame rate drops and the application starts to react to touch inputs in a strange way.

I gave a look at the source code of the application and I found out that a refactoring of specific parts of code would be desiderable, in order to improve performance and code maintainability in a longer term.

General

  • Remove usage of AsemanTools from the app. I saw that they're used extensively for setting the width of UI elements. Ubuntu UI Toolkit already has it own "grid unit". If necessary, just keep the audio recorder component.

Message List Delegate

  • Remove any usage of QtGraphicalEffects components (e.g. DropShadow) from the delegate.

  • Remove any usage of UbuntuShape (or its "Shape" alias - which is deprecated) from the delegate. The big problem here is that UbuntuShape is an important component in the Suru Design language. A few different solutions are still available: 1) Use UbuntuShape.Flat aspect, which is a bit more lightweighted. 2) If the item to shape is small (like "Avatar"), it's possible to use a standard rounded Rectangle. The visual result will be the same since UbuntuShape does not behave like a squircle on small object.

  • Reduce the amount of bindings inside the delegate. They kill performance if there are too much, or they are too complex.

  • As a general rule, reduce the number of lines that declares the delegate, I have counted ~1300. Be aware that a single UbuntuShape into a ListView delegate with only ~30 lines (and based on C++ written, optimized components from UITK) may cause a lot of flickering. Reducing the number of lines is therefore vital.

  • Instantiate internal components for quotes, link, or medias only when required. Use a Loader for that.

  • Consider to split the delegate into more delegates, and load the right one with a Loader. AFAIK if a message is just a Picture, or an Audio/any other file, Telegram does not allow to add any text message, quote or link, therefore you could consider to create a separated MessageMediaDelegate and choose to load it when necessary.

  • As ultimate resource, consider to implement a flat design, avoiding any drop-shadowed, ubuntu shaped, or bubble-like component.

I have written this report as a general "task tracking" board. Feel free to split it in smaller parts if you need it.
Thanks for resuming the development of a such important app for the Ubuntu Touch platform!

secret chat history has wrong query parameter "max_date"

When receiving secret chat messages the following log entry happens:

[20170607 20:54:41.326 CEST qml: telegram error: MAX_DATE_INVALID
[20170607 20:54:41.326 CEST error_slt 400 "MAX_DATE_INVALID" "messagesReadEncryptedHistory"

The message appears continously when a secret chat dialog is active.

Failure to hide the buttons

Hello.
I installed the new version (V2 4.41) on my BQ Aquaris 4.5 (OTA1) but the buttons (stikers and attachments) remain visible.
The only thing that happens when you start typing the message is the disappearance of the "audio" button and the appearance of the blue arrow for sending.
This fact, in addition to not changing the box size to write the message, makes it impossible to attach a voice message after typing text, because the audio attachment button can not be retrieved again.

Thanks again for your wonderful contribution !

GM

Not possible give permission to app to use microphone

When, in first time, put in microphone icon to start record a clip. The app inform you that is necessary give permission. When you put the button, open permission settings area. But the microphone permission not enabled. Not possible enable the permission. Telegram can not use the microphone.
Telegram version: 2.4.40.0
Device: Bq m10 FHD - Ubuports 27/5/17

Audio messages on secret chats

I tried to send an audio message on a Secret Chat to an Android device and it received the audio message as an .ogg file.

Add a search option

Telegram has an impressive search option which isn't available on the ubuntu phone version.

photo_2017-07-03_21-26-08
photo_2017-07-03_21-26-10

Media files not always correctly downloaded

Sometimes when you receive photos there are some that are not correctly downloaded (it mainly happens when receiving a lot of images). (see screen-shot)

I have tested some things:

  • if you download the image and open if with the gallery app it looks the same as on telegram
  • if you forward the image in telegram, it will appear entirely (maybe because telegram is cloud based?)

I don't know how this could be solved, maybe a "refresh"?
image

watching different account fotos

very often telegram users uploaded more than one foto. but on the ubuntu phone app it is just possible to see the main account foto from each user.
it would be nice to be able to see all of them.

thanks for continuing development

Increase GUI "readability": Rework button for stickers

The Ubuntu Touch keyboard shows a kind of globe symbol for the emoji keyboard, and the Telegram app shows an emoji for the sticker selector.

It would be good to rework those 2 symbols in such a way that:

  • The keyboard shows a (colorful?) smiley to clearly indicate that this is the button for emojis
  • The telegram app shows the "tilted face in a box" to give impression of a sticker (similar to Android app)

File sharing

When I decide to share, for example, a photo, using Telegram I open the gallery, choose the photo, choose the sharing option and select Telegram.
The problem is that Telegram only allows me to choose the Chat to which to send the photo.
I can not choose the contact.
So if I want to send a photo to a contact (and with this person I do not have a chat yet) this is impossible.
However, I do not know if this problem is a problem with the App Gallery, the share management system, or the telegram application.

Add support for locale override for special languages

Currently Ubuntu Desktop is not available in all languages. But we got the possibility to add these languages via po files to the source code.

First case is Sardinian ("sc") locale which we got fully translated for Telegram, but it cannot be used since Ubuntu does not allow to select it.

What is missing is a possibility to switch the locale so that the App picks up an override on startup.

Chat animations

The audio message button sometimes doesn't work or it's animation when it's recording takes some time to show up. Also, there's no animation when you receive a message or you send it on chat.

I recommend adding a counter that shows how long the user is talking while recording the audio message.

no push notifications

Hallo,
it's nice to see some development going on.
This is my first issue posting here, so I'm sorry for making any faults.

I haven't get any push notifications from my telegram app on my ubuntu phone since one month or so.
Right know I installed the OpenStore and updated telegram (thanks for voice massages!)

But there are still no push notifications. Do you know the reasons?

Device: Meizu MX4
Telegram version: 2.4.39.6

thanks for helping me
flaun

White screen after server side logout

When telegram-app is disconnected from the server, the app cannot start anymore, it shows a white screen instead of the login code request page (phone number is already known to app so this step is skipped).

How to reproduce:

  • Login to another telegram instance
  • Disconnect the affected telegram-app session from settings
  • Open telegram-app on affected device
  • Follow the welcome screen
  • Enter phone number
  • DO NOT enter code, but close telegram
  • Wait 2 mins
  • open telegram app again

The server will send the previous auth code again. So it looks like the server just thinks, ok code got lost, lets send it again. But the client does not change to the code input screen properly.

Log from affected user:

Loading module: 'libubuntu_application_api_touch_mirclient.so.3.0.0'
[20170504 18:06:02.876 BST "UpgradeV2" nothing to do for v1
[20170504 18:06:02.940 BST QQmlComponent: Component is not ready
[20170504 18:06:02.940 BST "file:///opt/click.ubuntu.com/com.ubuntu.telegram/2.4.39.6/themes/Abrisham.qml:-1 File not found
"
[20170504 18:06:03.081 BST virtual void OnlineAccountsClient::Plugin::registerTypes(const char*) Ubuntu.OnlineAccounts.Client
[20170504 18:06:04.662 BST QFSFileEngine::open: No file name specified
[20170504 18:06:05.399 BST could not open containers config file "/home/phablet/.local/share/libertine/ContainersConfig.json"
[20170504 18:06:05.640 BST qrc:/qml/telegram.qml:204:21: Unable to assign [undefined] to QObject*
library "/vendor/lib/egl/libGLESv2S3D_adreno.so" not found
[20170504 18:06:06.192 BST qrc:/qml/telegram.qml:73: TypeError: Cannot read property 'registered' of null
[20170504 18:06:06.300 BST qml: authNeeded true
[20170504 18:06:06.300 BST qml: authLoggedIn false
[20170504 18:06:06.350 BST qml: authPhoneChecked true
[20170504 18:06:06.416 BST qml: authNeeded true
[20170504 18:06:06.417 BST qml: authLoggedIn false
[20170504 18:06:06.417 BST qml: authCodeRequested
[20170504 18:06:13.479 BST qrc:/qml/telegram.qml:73: TypeError: Cannot read property 'registered' of null
[20170504 18:06:53.665 BST qrc:/qml/telegram.qml:73: TypeError: Cannot read property 'registered' of null
[20170504 18:06:56.092 BST qrc:/qml/telegram.qml:73: TypeError: Cannot read property 'registered' of null

Support for supergroups

  • Join a supergroup by link
  • Leave a supergroup (works partially, on server we leave but it takes too long. Local content must be deleted correctly)
  • See participants count on both header and profile page of supergroup
  • See list of participants (not loading all of them, but paging the result when scrolling through
  • See own message immediately when sending
  • Correct read/unread status (API-53 fixes that)

Keyboard kept open upon opening stickers with v2.4.41.0

Hello,
since v2.4.41.0 the on-screen keyboard stays open if you click on stickers. This could work on large screens but on small phones like MX4 the box with all the stickers doesn't fit to display and is cut off on the top - which makes using stickers a bit unusable unless you manually hide the keyboard .

With previous releases this worked just fine but once "hiding some buttons on text field not empty" was implemented this stopped working.

The expected behavior is to either have the keyboard shown or the stickers shown but to avoid having both on screen at one time.

Thank you very much for looking into this.

Martin

Disparity with official clients: Behaviour after deleting chat history

Interesting different behaviour between desktop client and Ubuntu:

  • Deleting history from Ubuntu phone: Chat window is empty
  • Deleting history from Desktop: Message "history has been deleted" appears on Ubuntu phone. this message is not localized!

If you enter the chat which history has been deleted immediately after, and the other party then writes smth, no new messages will arrive.

Also the sorting will move the chat to the end of the list, since there are no messages inside after which it would stay in the list. This is optional discussion, what would be the expected behaviour.

Cannot closes secret chats

image

How to reproduce:

  • Crash a secret chat
  • Try to close crashed chat

Expected
Chat gets removed from the list

Result
Chat remains at the very top of the list

Implement PFS for secret chats

It seems that Cutegram does not implement PFS (perfect forward secrecy) for secret chats, which is mandatory for all clients. This could get a little difficult to squeeze into the old client, but it could be worth the effort.

Telegram lost notifications

As for May 20 I've lost notifications of incoming messages in Telegram. It was was working perfectly with Bq E5 legacy image, and last Telegram version from OpenStore.

"writing a message"

When you write a message normally you only need to write, not more. But since there is the smiley icon (for stickers), the attachment icon and the record icon, there is only a really little box to write.
Is it needed to have all this icons even when you write? Would it be possible to hide them when writing in order to have a bigger text box?

image

Changing Group Title

While changing Group's title, if you completely erase the name, it will show "New group chat title" but it won't let you write anything.

More Info:
-Device: Meizu Pro 5 Ubuntu Edition [turbo]
-Channel: rc-proposed
-Version: r259

Telegram crashes

Telegram crashes sometimes and I have to clear cache data and config data to use the app again. It opens the app, shows the chat list a second and it closes.

More Info:
-Device: Meizu Pro 5 Ubuntu Edition [turbo]
-Channel: rc-proposed
-Version: r259

Photo compression

Our unofficial Telegram version does not compress the photos being sent. This fact causes heaviness in file transmission. If I'm not mistaken, the desktop version (linux) that I usually use to compress files before sending (similar to whatsapp)

Secret chat, secret buttons?

I get this "Waiting for user to get online..." message at the bottom on a Secret Chat because the receiver didn't logged into Telegram. But Sticker icon and Attachment icon still work even they don't show up.

Support pinned chats

In telegram you can pin 5 chats, these can be one on one, or group chats, this makes sure they stay at the top of the list at all points, this isnt available on telegram on ubuntu.

Update translations

Latest version is missing some translations. Update POT file and hand it out to some translators.

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.