majn / telegram-purple

Adds support for Telegram to Pidgin, Adium, Finch and other Libpurple based messengers.
GNU General Public License v2.0
734 stars 81 forks source link

Roomlist API: progress complete callback never called #295

Open vitalyster opened 8 years ago

vitalyster commented 8 years ago

Please add :)

BenWiederhake commented 8 years ago

How do you mean? The "Roomlist" button in Pidgin (and other libpurple clients, too, I assume) already shows you the full list of all joined group chats. Is this not what's happening? Did you expect something else?

vitalyster commented 8 years ago

Sorry, haven't try in pidgin at the moment of writing (it doesn't work in spectrum2) Just tried in pidgin: I have only one group, which doubles in room list as (group, 46 participants) and (supergroup, 0 participants), so I assume there is something wrong in room list

vitalyster commented 8 years ago

Why I think roomlist api didn't supported - I didn't found in logs any in_progress callback, spectrum's roomlist handler only have in_progress callback handler and it successfully show room list in other purple plugins

majn commented 8 years ago

Well, roomlist doesn't need to load anything, it just shows all known chats, so thats why it doesnt log in_progress

majn commented 8 years ago

What kind of chats are you missing? Which version are you on?

vitalyster commented 8 years ago

@majn I think one call to in_progress with complete=true will be suffice

vitalyster commented 8 years ago

@majn no, not missing anything, but my only supergroup showed up twice (as group and as supergroup) using https://github.com/majn/telegram-purple/commit/0340e4f14b2480782db4e5b9242103810227c522

mightyBroccoli commented 7 years ago

Are there any news on this issue? I am getting errors like crazy if somebody tries to search the roomlist like

11248: 2017-03-30 18:19:02,975 ERROR backend: g_log tgp_blist_lookup_peer_get: assertion 'id' failed

mightyBroccoli commented 7 years ago

I am using the plugin inside pidgin locally and with the same account inside my spectrum2 transport. The only difference I found is within the account.xml of purple. In my local installation of purple the accounts.xml

<account>
        <protocol>prpl-telegram</protocol>
        <name>+phonenumber</name>
        <statuses/>
        <settings>
            <setting name='media-size-threshold' type='int'>8192</setting>
            <setting name='buddy_icon_timestamp' type='int'>0</setting>
            <setting name='send-read-notifications' type='bool'>1</setting>
            <setting name='password-two-factor' type='string'></setting>
            <setting name='last-server-id/123456789' type='int'>6047</setting>
            <setting name='inactive-days-offline' type='int'>5</setting>
            <setting name='compat-verification' type='bool'>0</setting>
            <setting name='display-read-notifications' type='bool'>1</setting>
            <setting name='accept-secret-chats' type='string'>ask</setting>
            <setting name='history-retrieve-days' type='int'>30</setting>
            <setting name='auto-join-group-chats' type='bool'>1</setting>
            <setting name='use-global-buddyicon' type='bool'>1</setting>
        </settings>
        <current_error/>
</account>

and on the server spectrum instance of purple the account.xml

<account>
        <protocol>prpl-telegram</protocol>
        <name>+phonenumber</name>
        <alias>mightyBroccoli</alias>
        <statuses/>
        <settings>
            <setting name='custom_smileys' type='bool'>0</setting>
            <setting name='direct_connect' type='bool'>0</setting>
            <setting name='buddy_icon' type='string'><ydgsdxhcfzj.png</setting>
            <setting name='compat-verification' type='bool'>1</setting>
            <setting name='last-server-id/1078253661' type='int'>6047</setting>
            <setting name='buddy_icon_timestamp' type='int'>1491861237</setting>
        </settings>
        <settings ui='spectrum'>
            <setting name='auto-login' type='bool'>1</setting>
        </settings>
        <current_error/>
</account>

I am not sure if this is helpfull.

majn commented 7 years ago

https://github.com/majn/telegram-purple/commit/7dc7f61ca4c4724fd5fb7df81f5c925c4ec27fb4

I made a patch and included the calls to set_progress. I would need you to test whether the change fixes it, cause I don't use Spectrum. You need to check out the dev-1.4.0 branch to build it:

   git checkout dev-1.4.0 
   git submodule update --recursive 

and then regular installation routine as described in the README e.g. configure/make/install

mightyBroccoli commented 7 years ago

I just saw this merge and I am really happy to see that. I just compiled and installed everything its up to testing now. But first here are my log files from a to z. configure make and make install logs

I will edit this post when I am done testing. @majn I installed the plugin but i can not see any rooms. Trying to search for rooms on the telegram component ist not possible and in the backend log file that seeems to be the important part I guess but I can post my whole log if that helps but 50000 lines+

8053: 2017-04-11 22:52:06,880 INFO  libpurple: prpl-telegram:tgprpl_roomlist_get_list()
8053: 2017-04-11 22:52:06,880 INFO  backend: RoomList is still in progress
8053: 2017-04-11 22:52:06,880 INFO  backend: Uknown RoomList field id
8053: 2017-04-11 22:52:06,880 INFO  backend: Uknown RoomList field type
8053: 2017-04-11 22:52:06,880 INFO  backend: RoomList is fetched for user broccoli@magicbroccoli.de
8053: 2017-04-11 22:52:06,880 INFO  libpurple: prpl-telegram:loading known ids from buddy list ...
8053: 2017-04-11 22:52:06,880 INFO  libpurple: prpl-telegram:read secret chat file: 0 chats read
8053: 2017-04-11 22:52:06,881 INFO  libpurple: dnsquery:Performing DNS lookup for 149.154.167.51
8053: 2017-04-11 22:52:06,882 INFO  libpurple: signals:Signal data for chat-conversation-typing not found!
8053: 2017-04-11 22:52:06,882 INFO  libpurple: dnsquery:IP resolved for 149.154.167.51
8053: 2017-04-11 22:52:06,882 INFO  libpurple: proxy:Attempting connection to 149.154.167.51
8053: 2017-04-11 22:52:06,882 INFO  libpurple: proxy:Connecting to 149.154.167.51:443 with no proxy
8053: 2017-04-11 22:52:06,882 INFO  libpurple: proxy:Connection in progress
8053: 2017-04-11 22:52:06,895 INFO  libpurple: proxy:Connecting to 149.154.167.51:443.
8053: 2017-04-11 22:52:06,895 INFO  libpurple: proxy:Connected to 149.154.167.51:443.
8053: 2017-04-11 22:52:06,925 INFO  libpurple: dnsquery:Performing DNS lookup for 149.154.167.51
8053: 2017-04-11 22:52:06,925 INFO  libpurple: dnsquery:IP resolved for 149.154.167.51
8053: 2017-04-11 22:52:06,925 INFO  libpurple: proxy:Attempting connection to 149.154.167.51
8053: 2017-04-11 22:52:06,925 INFO  libpurple: proxy:Connecting to 149.154.167.51:443 with no proxy
8053: 2017-04-11 22:52:06,925 INFO  libpurple: proxy:Connection in progress
8053: 2017-04-11 22:52:06,938 INFO  libpurple: proxy:Connecting to 149.154.167.51:443.
8053: 2017-04-11 22:52:06,938 INFO  libpurple: proxy:Connected to 149.154.167.51:443.
8053: 2017-04-11 22:52:06,944 ERROR backend: g_log tgp_blist_lookup_peer_get: assertion 'id' failed

Also in the backend log file are these lines I think there is something wrong. backend log paste

majn commented 7 years ago

So the patch didn't work, we need to remember to undo the commit then.

mightyBroccoli commented 7 years ago

I am really not sure I am not capable of getting messages from groups or channels through spectrum2. I tried it several times to compile and install and then uninstall and recompile and install from a fresh maschine. I used 2 different clients pidgin and gajim but both did not success in using groups. Thats why I gave all my log files and stuff to maybe give you a hint what is wrong or not working properly.

mightyBroccoli commented 7 years ago

@majn I have a running spectrum2 instanz with telegram 1.4.0 set up if you want to try it yourself except the building eg part contact me. XMPP broccoli@magicbroccoli.de

vitalyster commented 7 years ago

@majn it looks like spectrum asks groups too early (in "signed-on" signal handler) when telegram-purple does not receive full buddy list, and telegram-purple sends empty roomlist. I see empty room list also in finch

mightyBroccoli commented 7 years ago

It seems that the conversation messages are recieved but the plugin is not able to display them. I just saw with dev-1.4.0 that I get this line over and over again 2017-04-14 12:56:14,667 WARN NetworkPluginServer: handleConvMessagePayload: No conversation with name Fancy Conference Name And then i tired to open a chatroom on the telegram component url and I did not get the error from 1.3.1 that a user tried to open a empty room.

majn commented 7 years ago

Yes, this seems to be the problem. You can see that telegram:tgprpl_roomlist_get_list() is being called before telegram-purple is even connected to the server.

mightyBroccoli commented 7 years ago

new logout puts spectrum2 log and backendlog in one file I am able to see the channels and groups now but when I join they are empty and I dont recieve any messages in them.

vitalyster commented 7 years ago

@mightyBroccoli please don't mix up spectrum and telegram-purple issues

majn commented 7 years ago

@vitalyster I requested it

vitalyster commented 7 years ago

0c9fa0b23087b7cc4886bdb8598983a170b6c38e works for me

mightyBroccoli commented 7 years ago

I am not sure if this problem is still under construction. I am able to use spectrum with this plugin when chatting with ppl in normal groups. It does work there are some issues with the nicklist but that is neglectable. But I am not able to chat with ppl in Channels I am not sure why this is.

asdil12 commented 7 years ago

How did you join the group (in your xmpp client) and what does the JID of the muc look like?

Am 14. Juni 2017 19:22:27 MESZ schrieb nico notifications@github.com:

I am not sure if this problem is still under construction. I am able to use spectrum with this plugin when chatting with ppl in normal groups. It does work there are some issues with the nicklist but that is neglectable. But I am not able to chat with ppl in Channels I am not sure why this is.

mightyBroccoli commented 7 years ago

I did join the group just as I would join a normal XMPP Chatroom. In my case Gajim Looking for rooms telegram.URL.tld and there are all the rooms listed my client has access to. The Chatroom names are roomname@telegram.URL.tld just like they should be and there are no differences between normal chatrooms and channels identifiable through the name