-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Mattermost v4 #73
Comments
plus one vote. Any plans to add support for v4? |
Are there any differences on v5 (and 5.1) that need to be accounted for? |
Oh damn, we still didn't catch up to v4 and v5 is already happening? I'll make this my priority over the next week to get sorted. I'll have a look at the docs and see what changes there are between v4 and v5, but I plan to write it all in such a way to keep v3 -> v5 compatibility (I'm still connected to a server that's on v3 and doesn't look like it's going to be upgrading any time soon) |
@ylluminate mattermost-server dropped API v3 support since version 5.0, so you cannot use this plugin until API v4 supported. |
@EionRobb Anywhere/any way we can throw in a bit of .. ahem .. motivational support to get this done sooner rather than later? :) |
My wife just had her baby early. There may be some delay getting back to this, sorry. :) |
Hi all ! @EionRobb :
|
Call for testers: the v3 -> v4 API porting should be complete now, please try: https://github.com/EionRobb/purple-mattermost/tree/v4api_try1 (anybody using pidgin/libpurple 3 ? .. I only tired it with 2) |
@jaroslawp Thank you for your time and effort. Using libpurple 2.10.12-0ubuntu5.2. Following commands:
produced a valid .so file without any problems. Here comes first set of test results:
Waiting for try2... |
Works for me with private messages in spectrum2 as jabber transport, but #60 still occurs. |
@AlexeyGusev : Thanks for testing ! Ad1: OK, please checkout & compile again - I made that error silent for now (it seems that v5 server has no endpoint api path defined for non-defined user preferences: that 'error' is not affecting anything, and will be gone when user 'deletes' a direct / group channel from Web UI) Ad2: This is rather feature request independent of v3 -> v4 API migration, please open a separate one. Ad5: This is a bug also already present in v3 API I believe - please open a separate bug report. @p5n : Thanks for testing ! yes .. this is only v3->v4 API update ... for #60 (and others ... I will try to find some time after summer holidays ..) |
Previously I used adapted for spectrum2 and xmpp own fork: https://github.com/p5n/purple-mattermost It works slightly better with xmpp, but I did not port it to v4 yet. This fork has fixed #60, but it has also many changes regarding convenient use in XMPP. |
Tried just now using pidgin, seems to work so far, thank you very much for updating the plugin! |
@jin-eld : thanks for testing, latest commit also includes chat history rewrite (still to be polished a little..) |
@jaroslawp What does it do? Will it fetch the messages from the server that were written to me while I was offline? I was missing that in the old v3-API plugin version :) Btw, when compiling there's a little warning:
Does not look like anything serious, but I thought I'd still mention it. |
Last commit coredumps :( I'll see if I can get a backtrace. |
I hope this helps, its enough to just let it run for a while.
I am on commit d1ec531 |
@jin-eld : many thanks for testing, the latest commit possibly fixes these. |
@jaroslawp : if you need more info in places which you are unsure about, just add debug logs and I'll start pidgin in a terminal with debug output. I more or less have no choice, our mattermost server at work has been updated and since I find the browser UI to be terrible and unpractical I am really happy there is at least something that is working with pidgin again :) I understand that its work in progress, that's fine, most importantly - its already usable, so thank you for coding it, keep hacking! I'll see that I stay up to date with your branch, so I'll let you know if something crashes or does not work as expected ;) That being said, "search for users" does not find anyone, I assume you did not have time for it yet? |
You can run pidgin with --debug option to capture logs (be aware these will contain lots of personal info..) As for search for users: interesting - that works for me, please check with pidgin --debug, search for users and look for lines in the log alike:
then the reply (note these can be interleaved with other replies in the log):
|
Thats weird, my log looks like yours, except that I get [] as a response... this used to work in v3, but then again - our server was updated, maybe its a server side problem.
|
I noticed that the history part does not seem to work properly. It does not correctly download offline messages from the server and now I had a case where my current chat was suddenly reset to something older (i.e. messages in the chat window changed, jumping back in time). This may be related to logging in to the server via a browser in parallel (I do that once a day to check if I missed any offline messages). Edit: it seems that I am also missing messages from time to time. A new tab chat popped up, but displayed old history. I did not have a second browser session to the server, was connected only via pidgin. Then I doublel checked on the server via browser chat, and saw that I was actually supposed to have a new message in the chat that popped up, however in pidgin this message was missing. |
Many thanks for testing ! Lets test if that works better now. There are still bugs described in README and there may be some crashes (possibly) and some memory leaks (likely). |
The behaviour got better, but I had one crash, unfortunately no trace. Just had it running, did not do anything special. The second crash happened when I logged in via a browser in parallel to my running pidgin session: #0 0x00007ffff2ff52a0 in g_str_hash () at /lib64/libglib-2.0.so.0 #1 0x00007ffff2ff46f4 in g_hash_table_lookup () at /lib64/libglib-2.0.so.0 #2 0x00007fffe45f9b68 in mm_get_history_of_room (ma=0x5555561d0450, channel=, since=-1) at libmattermost.c:4362 #3 0x00007fffe45fb5b5 in mm_get_users_by_ids_response (ma=0x5555561d0450, node=, user_data=0x55555613b300) at libmattermost.c:2080 #4 0x00007fffe45f20c9 in mm_response_callback (http_conn=, user_data=0x5555560d6940, url_text=, len=, error_message=0x0) at libmattermost.c:1146 #5 0x00007ffff4e0c9f5 in url_fetch_recv_cb () at /lib64/libpurple.so.0 #6 0x00005555555c94be in pidgin_io_invoke () #7 0x00007ffff3005b77 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0 #8 0x00007ffff3005f20 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0 #9 0x00007ffff3006232 in g_main_loop_run () at /lib64/libglib-2.0.so.0 #10 0x00007ffff6b19827 in gtk_main () at /lib64/libgtk-x11-2.0.so.0 #11 0x000055555558f9d5 in main () This is nicely reproducible btw. |
Thanks !, last commit (76f5faf) should fix most of these problems / crashes. It seems that the plugin is working now for v4 API with same functionality it had for v3 API, there are some memory alloc/dealloc to review plus more debugging/testing needed. I will be away from keyboard for next two weeks .. so further followup on this .. only in September .. |
Great, thank you! Seems to work so far, the crash is gone. Let's see if I come up with more traces till September ;) |
Being forced to use Mattermost (rather XMPP in the past) at work, I tried 76f5faf: Works except for rooms/channels; on the first connect I see e.g. 2480 persons in a room/channel using libpurple while the room/channel has actually < 20 people. It heavily varies for each room/channel, likely related to the amount of written messages? However when closing the channel in Pidgin and re-opening it, it looks normal as it seems?! Oh and when trying to use this libpurple plugin via https://github.com/bitlbee/bitlbee, a failed connect to the Mattermost server (e.g. wrong password, expired/hijacked GitLab authentication cookie) hangs up the whole BitlBee somehow (until BitlBee process is killed using
|
similar behaviour here, but every user gets multiplied by random number in the list of room users: in one room, you could see 6 entries or User A, 6 entries of user B and so on for all given room users; in another room, you could see 100 entries of User A, 100 entries of user B etc. |
Interestingly enough the above does not happen for me (using Pidgin), but then again I have only one room with 6 people where I'm in. |
I think, I was able to track it down: I only see these zillion person duplicates in a room/channel when I was added on server-side to a room/channel. If I remove the room/channel from the buddy list in Pidgin explicitly and join the room myself using Pidgin, it looks normal. And if purple-mattermost would work with BitlBee (rather just hanging it up like mentioned above), it really would be great :) |
User list duplicates should be fixed now. As for history: it .. may .. be (mostly) fixed now If you see duplicates in history parts: these may come from client logs. History ordering is slightly incorrect:
|
ver 0e126dd
|
happens during pidgin startup, maybe has some value, not just noise |
Looks good so far, no duplicates for me either, thank you! However I see another small issue: I disabled notifications for a channel, but I still get messages from there in pidgin. It's some persistent channel that I can't get rid of, but disabling notificatoins was possible in the mattermost web UI. Is there something missing in the plugin to supress messages when channel notifications are disabled or is there any other way to ignore it? |
There's one more issue that I noted, when a new user joined a channel, his nickname appeared empty in the nicknames list on the right hand side. In the chat the message "user xx joined the channel" was correct though. |
@jin-eld: thanks for reporting - can you try this branch: https://github.com/EionRobb/purple-mattermost/tree/cleanup-1 (please move away ~/.purple/blist.xml again). I've made some code cleanup for setting up aliases for users/chats and this may fix it. |
As Mattermost has developped a v4 which is incompatible with the previous versions of the API, I would like to know if there is any kind of project to support this new version.
The text was updated successfully, but these errors were encountered: