filippz / telegram_import

Import back messages exported from Telegram into JSON format
14 stars 2 forks source link

how to use only import part? #3

Closed lorvent closed 9 months ago

lorvent commented 9 months ago

Hello, since my backup is in html, i found another program which can convert directly into txt format (whastapp format)

so is there anyway, i can use your code only for import purpose?

i mean..how to strip/comment out txt conversion part and use only import part.

thanks.

filippz commented 9 months ago

There is no need for third party apps for WhatsApp import as it's possible to do it in official Telegram app for Android - simply name your txt file WhatshApp.txt (https://github.com/DrKLO/Telegram/blob/33a48d8945654afdb99df778647251cc2fca4bcc/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java#L1475) and store it somewhere on your phone and then when you share that txt file via Telegram the app will import that file in the selected chat instead simply sending it as a message attachment.

lorvent commented 9 months ago

but as i told you earlier, when i do that...all history is coming on left side

where as when i use your import, chats are adjusted on both left and right sides depending on who sent it.

if what i am trying to say is not clear to you... i can send you screenshots.

thanks.

filippz commented 9 months ago

When you look at the WhatsApp file my code produces you can see that there is just "screen name" of the message sender - so I would say that Telegram servers parse the file in such a way that they compare that name with your name as seen by Telegram and if it's the same it considers those messages as sent by you: 01/07/23, 19:07:25 - Some Name: message

Can you check if your txt file has the same Some Name part as the name in Telegram? My guess would be that you can simply use a text editor to search/replace - Some Name: with - Name In Telegram:

lorvent commented 9 months ago

Thanks... that worked!

but when i try with txt file, its not importing media eventhough media exists in same folder...

i will dig about that....