Giter VIP home page Giter VIP logo

purple-mattermost's Introduction

Pidgin-Mattermost plugin by Eion Robb

Connects libpurple-based instant messaging clients (such as Pidgin, Finch, Adium, bitlbee) with Mattermost server.

Features

Setup & Navigation

  • Installer for setting up Pidgin-Mattermost with Pidgin.
  • Connect to Mattermost server using email/username & password.
  • Connect to Mattermost server using AD/LDAP credentials.
  • Connect to Mattermost server using GitLab cookie authentication (MMAUTHTOKEN workaround).
  • Automatically add buddies and joined channels to buddylist and keeps the list in sync with the server.
  • Automatically keeps chat topic in sync with the server.
  • Add/Remove buddies.
  • User search via Accounts > {Mattermost Account} > Search for Users...
  • Channel search via Accounts > {Mattermost Account} > Room List
  • Server information via Accounts > {Mattermost Account} > Server Info

Not implemented yet:

  • Add/Remove chats.
  • ...

Core Communication

  • Send and receive messages, including weblinks, emoji and images.
  • Display of online/offline/busy/away status.
  • Sending of read notifications so the server understands users is still online.
  • Display of messages sent while Pidgin was offline.
  • Mark messages edited by a Mattermost user as "Edited:"
  • If Mattermost enables public file links (off by default) file sharing links can be displayed in Pidgin.
  • Display of emojis (install Pidgin EmojiOne smileys theme)

Group Discussions

  • Join a public and private channels and multi-party direct message channels by right-clicking on channel in Buddy List and selecting.

1-1 Discussions

  • Open Direct Message discussions from a Room by right-clicking on the user name and selecting IM.

Advanced Mattermost Features

Screenshots

s

End User Install Guides

Please see install guides for setting up Pidgin-Mattermost

This plugin includes it own installer for setting up on Windows:

s

Developer Install Guide

For modifying or extending this project please follow the Linux Client Install Guide to set up your environment.

Changelog

  • April 18, 2017 - Pidgin-Mattermost v0.0 - Project started
  • April 23, 2017 - Pidgin-Mattermost v1.0 - Initial Release
  • April 28, 2017 - Pidgin-Mattermost v1.1 - Support non-HTTPS servers, various fixes
  • September 20, 2017 - Pidgin-Mattermost v1.2 - Gitlab authentication, Multi-team support, various fixes

Verification

The following table outlines the results of verification tests completed on different client platforms.

Version Verification Plan Analyst Verification Date Bugs Found
Pidgin 1.0 Win10 Tests v1.0 Ian Tien April 23, 2017 #4

Contributions to testing and verifying this projects are highly welcome, read our verification contributions documentation to learn how you can help.

purple-mattermost's People

Contributors

andy-b-84 avatar audeoudh avatar avas27jtg avatar denics avatar e3rd avatar eionrobb avatar hrishavkmr avatar it33 avatar jaroslawp avatar jellyfrog avatar jnmbk avatar peja avatar sei-eschwartz avatar thepanz avatar thorgrin avatar vitstradal 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  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

purple-mattermost's Issues

crash in free(markdown_str) on RHEL 7

On RHEL 7 markdown is version 2.1.8 (from EPEL repository), therefore it should be marked as 'not safe' at detection time.

Unfortunately it reports its own version as "2.1.8 DEBUG DL=DISCOUNT FENCED-CODE" and mm_markdown_to_html() labels it as 'safe': this results in crash in free(markdown_str)

Connection keeps "crashing" when I use private (direct) messages

Great work so far! I'm looking forward to using this as a matter of course! However I run into a show-stopper for the time being...

When I send or receive private direct messages, the connection from Pidgin to the Mattermost server seems to crash. I receive the "$user is typing..." and the message from $user, but then the connection closes. It re-establishes after some seconds.

Similarly, I can send a (single) message to $user, then the connection immediately closes. It re-establishes after some seconds. $user does receive my message.

I can send and receive messages in normal channels perfectly.

The error I get is this one:

$mymattermostuser|$mattermosturl heeft de verbinding verbroken
Connection error: Er is een fout opgetreden bij het lezen van$mattermosturl: De andere gebruiker heeft de verbinding verbroken..

Translation:

$mymattermostuser|$mattermosturl has closed the connection
Connection error: an error occurred when reading $mattermosturl: The other user had closed the connection..

Invalid or expired session, please login again.

Thanks for this awesome plugin! It has been working for the last year or more, but recently I disabled one Mattermost account because I had been getting a lot of messages. I then re-enabled it today and I'm getting a strange error specifically: Invalid or expired session, please login again.

http: Timeout reached for request 0x55d59935dd40 (12:07:42) http: Request 0x55d59935dd40 performed without success. (12:07:42) mattermost: Got response: (12:07:42) connection: Connection error on 0x55d599a10490 (reason: 2 description: Bad username/password) (12:07:42) jabber: jabber_actions: have pep: NO

I feel that this is probably the most important section of the logs. It seems that it keeps trying but gets a timeout although I have no issue with the web interface.

After that we have

mattermost: Fetching url https://chat.somedomain.org/api/v4/users/me/status (12:07:42) mattermost: With postdata {"status":"online"} (12:07:42) http: Performing new request 0x55d599523300 to chat.somedomain.org. (12:07:42) GLib: g_source_remove: assertion 'tag > 0' failed (12:07:42) GLib: g_source_remove: assertion 'tag > 0' failed (12:07:42) http: Request 0x55d599523300 performed without success. (12:07:42) mattermost: Got response: (12:07:42) GLib: g_regex_unref: assertion 'regex != NULL' failed (12:07:42) GLib: g_regex_unref: assertion 'regex != NULL' failed

Is this really a cookie that is left over? Is there a way to actually wipe it (I already tried to remove the account and restart). Or this an error elsewhere?

Thanks!

Please, add support for non-ssl servers

I see that there is assumptions that all mattermost servers are running over https, yet it may be not true for smaller organizations.

url = g_strconcat("https://", ma->server, "/api/v3/files/", purple_url_encode(file_id), "/get_public_link", NULL);

Can we have an option to support non-https mattermost servers?

Problems with team_id being empty

I've recently pushed a fix for links to files which handles team_id being an empty string. However, it is probably a bigger problem as stated by

		//FIXME: in v4 api team_id is NULL for group chats, that breaks the code in many places.
		//       should be rewritten.

		//if (team_id == NULL || strlen(team_id) == 0) {
		//	team_id = mm_get_first_team_id(ma);
		//}

What would happen when we added this check whenever ma->channel_teams is written to? I've tried it and it solved my problem at a root, but there are probably side effects which I cannot see.

Can't send message to yourself

Mattermost allows you to send messages to yourself, via the web or mattermost client apps. Pidgin+mattermost plugin prevents this.
It looks like this may be a pidgin limitation not a plugin limitation, not sure...

Duplicate messages

Whenever someone 'likes' a posting via the mattermost app or web, that posting appears again in the Pidgin window. So the same message will appear multiple times.
Plus, the `liked' tag never appears in the pidgin log (but I don't really care about that)

Pidgin shows Mattermost users offline

The Mattermost plugin shows the online status of all Mattermost user as offline but the Mattermost Web-UI shows different online status.

Pidgin 2.10.12 (libpurple 2.10.12)
Plugin Information
Mattermost
	Author: Eion Robb <[email protected]>
	Version: 1.1.2017.06.30.git.2d04e44
	Website: https://github.com/EionRobb/mattermost-libpurple
	ID String: prpl-eionrobb-mattermost
	Loadable: Yes
	Loaded: Yes

Error sending message

Getting an error when trying to send messages:

"Invalid or expired session, please login again"

It fetches new messages on the channel but I am not able to send any.

Screenshot from 2019-04-25 16-00-27

Install on macOS Mojave fails

The brew option --with-shared is no longer supported, so I omitted it, but it seems this causes some missing dev headers.
Make fails with Error: You need GLib 2 and JSON-GLib development headers installed to be able to compile this plugin.

Hierarchy not preserved in view (1.1.2017.06.12)

At work, we run a Mattermost server with individual Teams and private channels.

The Pidgin plugin (as of version 1.1.2017.06.12) doesn't preserve this hierarchy but just renders everything flat, so that one cannot differentiate e.g. which "Off-Topic" and "Town-Square" one is posting to. Also checking the channel itself via right-click / Edit Settings only gives the human-unreadable Team/Channel IDs but no cleartext rendering of Team/Channel name.

It'd be great if the Team channels get prepended the name, e.g. PROJ1:Off-Topic, PROJ2:Town-Square, or at least given in cleartext in the Edit Settings so that the user can set an appropriate alias for the channel.

Inline reply?

Is there any way to do inline replies within a channel?

Mattermost api v4 not supported?

When I tried to log into our mattermost server, pidgin could not connect to server and after some research I have found, that this plugin is using mattermost API v3 calls. Our mattermost server version is 3.9, which have API v4.

I did'nt find any mention about API v4 here, so are there plans for this?

account disabled on every re-connect

I have to manually re-enable my mattermost account always when I am re-connected to the Internet. Pidgins shows this reason "Invalid or expired Gitlab cookie".

Icon hard to see on dark background

Not really an issue, but still. I have a dark task bar, that makes windows with the mattermost icon look as if they don't have any icon.

For myself, I just took that white-on-blue-gradient icon which the web client uses as favicon (or "apple-touch-icon"), that looks better. I have no idea how the whole image licensing stuff works, though, so I didn't dare to just make a pull request with these icons.

Another possibility would be to just add some light white shadow around the icon.

Non-emoji combos render as smileys

Emojis are rendered correctly; but combinations of letters that you would use to enter an emoji are rendered (incorrectly) as emoji.
For instance,
Edited: blah blah blah
(generated when someone alters a post)
is rendered:
Edite☺️ blah blah blah

As far as I know, d: isn't a smiley at all

no pasted images in chat

this might be a pidgin-issue and not a mattermost-plugin issue, but I will report it here anyway.

You can see pasted images with mattermost' own client in a chat, but pidgin displays only empty line followed by another line containing <a href=". Pasted graphics is not displayed.

Messages consisting of "attachments" don't show at all

For integration with bots, the concept of "attachments" are very useful to decorate the messages. Eg. a green, red or yellow vertical line will be shown next to the message as a visual cue to the outcome.

This is the incoming data according to the debug log:

(09:14:22) mattermost: got frame data:

{
  "event": "posted",
  "data": {
    "channel_display_name": "jenkins",
    "channel_name": "jenkins",
    "channel_type": "O",
    "post": "{\"id\":\"$post_id\",\"create_at\":1493709262220,\"update_at\":1493709262220,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"$user_id\",\"channel_id\":\"$channel_id\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\"\",\"type\":\"slack_attachment\",\"props\":{\"attachments\":[{\"id\":0,\"fallback\":\"$the_fallback_message\",\"color\":\"good\",\"pretext\":\"\",\"author_name\":\"\",\"author_link\":\"\",\"author_icon\":\"\",\"title\":\"\",\"title_link\":\"\",\"text\":\"\",\"fields\":[{\"title\":\"\",\"value\":\"$the_formatted_message\",\"short\":false}],\"image_url\":\"\",\"thumb_url\":\"\",\"footer\":\"\",\"footer_icon\":\"\",\"ts\":null}],\"from_webhook\":\"true\",\"override_username\":\"jenkins\"},\"hashtags\":\"\",\"pending_post_id\":\"\"}",
    "sender_name": "jenkins",
    "team_id": "$team_id"
  },
  "broadcast": {
    "omit_users": null,
    "user_id": "",
    "channel_id": "$channek_id",
    "team_id": ""
  },
  "seq": 3
}

In the above case, my Jenkins master writes a message consisting (only) of $slack_attachements; this message does not show up at all.

The color in this case is "good", meaning a green line is shown in the web ui.

More information about attachments here: https://docs.mattermost.com/developer/message-attachments.html

segfault on muc join

I am using Arch Linux and following versions:

spectrum2 2.0.3-5
libpurple 2.12.0-2
purple-mattermost-git v1.1.r89.g4524538-1

Private messages looks working but transport segfaults on MUC join:

(I've tried to use name as an id but it is also NULL, line 4011 is mine but result is the same on original sources)

(gdb) bt
#0  0x00007fbf7bbfcf30 in g_str_hash () at /usr/lib/libglib-2.0.so.0
#1  0x00007fbf696676c1 in mm_join_chat (pc=0x9fa3482b90, chatdata=Python Exception <class 'gdb.error'> There is no member named keys.: 
0x9fa3462910) at libmattermost.c:4012
#2  0x0000009fa1c1b0e7 in SpectrumNetworkPlugin::handleJoinRoomRequest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#3  0x00007fbf7b7347c5 in Transport::NetworkPlugin::handleJoinRoomPayload(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () at /usr/lib/libtransport-plugin.so.2.0
#4  0x00007fbf7b73536b in Transport::NetworkPlugin::handleDataRead(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) () at /usr/lib/libtransport-plugin.so.2.0
#5  0x0000009fa1c13169 in  ()
#6  0x0000009fa1c07293 in  ()
#7  0x00007fbf7bc0d8c5 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#8  0x00007fbf7bc0dc88 in  () at /usr/lib/libglib-2.0.so.0
#9  0x00007fbf7bc0dfa2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#10 0x0000009fa1c136be in main ()
(gdb) l
1	<built-in>: No such file or directory.
(gdb) up
#1  0x00007fbf696676c1 in mm_join_chat (pc=0x9fa3482b90, Python Exception <class 'gdb.error'> There is no member named keys.: 
chatdata=0x9fa3462910) at libmattermost.c:4012
4012		PurpleChatConversation *chatconv = purple_conversations_find_chat(ma->pc, g_str_hash(id));
(gdb) l
4007		MattermostAccount *ma = purple_connection_get_protocol_data(pc);
4008		const gchar *id = g_hash_table_lookup(chatdata, "id");
4009		const gchar *name = g_hash_table_lookup(chatdata, "name");
4010		const gchar *team_id = g_hash_table_lookup(chatdata, "team_id");
4011		if(id == NULL) id = name;
4012		PurpleChatConversation *chatconv = purple_conversations_find_chat(ma->pc, g_str_hash(id));
4013		
4014		if (chatconv != NULL && !purple_chat_conversation_has_left(chatconv)) {
4015			purple_conversation_present(PURPLE_CONVERSATION(chatconv));
4016			return;
(gdb) p id
$1 = (const gchar *) 0x0
(gdb) p name
$2 = (const gchar *) 0x0
(gdb) p chatdata
$3 = 0x9fa3462910Python Exception <class 'gdb.error'> There is no member named keys.: 

(gdb) p team_id
$4 = (const gchar *) 0x9fa3462a70 "off-topic"

Can't see 'private' chatrooms

If I create a 'private' channel via the mattermost web interface, with myself as only member, it appears correctly in the 'Buddy List' but when I try to Join the channel, nothing happens.

Mattermost v5: can't connect

The v4api_try1 branch was working for me. After it has been merged, I see always:
Invalid or expired session, please login again.
when trying to connect to the mattermost server.

I tried delete ~/.purple to remove any saved state, but get the same message afterwards.

Use API token

Hi,

Here at work, mattermost is behind an HTTP proxy filtering HTTP auth. We can use mattermost desktop client because it allows to open a session through a web form.

I read the GitLab cookie option and though it might be a good idea to accept API token as well. Do you know if this is possible ?

Thanks for this plugin. It looks lean and is very useful ! :-)

Regards,

separate buddies from channels

Pidgin shows a mix of end users (those that are under DIRECT MESSAGES category in mattermost client) and subscribed channels (private and public) in one list, A-Z sorted. My proposal is to show channels/rooms in the end of the list or in Chat subsection (however, channels end up in a Chat subsection when they are "added" from the room list. Don't know which way is better, maybe subscribed channels should be "added" automatically).

When logged into Pigdin and are added to a new channel, the channel id is displayed instead of name

Details:

  • If the invited user has the Pidgin client open at the time of the invitation, the channel shows as random characters and stays that way, even upon future sign-ins
  • If the user is not signed in at time of invite, the correct title shows upon sign-in

Replication Steps:

  • Login to Pidgin (and Mattermost)
  • Receive an invite to a private channel
  • Channel name in Pidgin shows as random characters

dialog flood: Your search for the user "..." returned no results

Hi,
I'm using two mattermost instances. The first runs smoothly. But the second (on another server) is unusable. When I try to interact any user (either I write him or they write to me), a dialog Your search for the user "..." returned no results starts popping out infinetely.

image

In the terminal, I see this debug messages.

(15:09:23) mattermost: Fetching url https://mm.cert.ee/api/v4/users/search
(15:09:23) mattermost: With postdata {"term":"@pl_certpl_monk","allow_inactive":true,"without_team":true}
(...)
(15:09:24) mattermost: Got response: []

Could I turn this broken search behaviour off? I haven't been searching for any user.
Thanks for the great plugin! :)

Bad username/password

Hello,

attempted to login to my mattermost server without success. hostname is mattermost.hexawin.fr (443). I'm pretty sure of my credentials (email/password or nickname/password).
Used Charles Proxy to decrypt the connection attempt, maybe it could help ?!
capture
Is there something to do on the server side ? It's a Debian Linux VM.

Thank u !

macOS support?

Are there any plans to support macOS? Would like to see this in action with Adium on macOS.

session expired without message

my pidgin did not notify me of my session having expired due to expired MMAUTHTOKEN until i tried to send a message.
would be great if pidgin would notify me of that by itself. our cookies expire once in a month and i almost everytime dont remember, that this could happen and miss the timeframe to get a fresh cookie.

my version:
Pidgin 2.13.0-9.fc30 (libpurple 2.13.0)
f07927902113041d6fa291293d9205ea4f05e9e6

running under fedora 30

CentOS install not working...

[todd.musheno@oh-c9q8jv2 ~]$ sudo yum install rpm-build json-glib-devel libmarkdown-devel libpurple-devel mercurial
[sudo] password for todd.musheno:
Loaded plugins: fastestmirror, langpacks
Repository nodesource is listed more than once in the configuration
Repository nodesource-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile

  • base: mirror.tzulo.com
  • extras: repos-va.psychz.net
  • updates: mirror.cs.vt.edu
    Package rpm-build-4.11.3-35.el7.x86_64 already installed and latest version
    Package json-glib-devel-1.4.2-2.el7.x86_64 already installed and latest version
    No package libmarkdown-devel available.
    Package libpurple-devel-2.10.11-7.el7.x86_64 already installed and latest version
    Package mercurial-2.6.2-8.el7_4.x86_64 already installed and latest version
    Nothing to do
    [todd.musheno@oh-c9q8jv2 ~]$ git clone https://github.com/EionRobb/purple-mattermost.git && cd purple-mattermost;
    Cloning into 'purple-mattermost'...
    remote: Enumerating objects: 70, done.
    remote: Counting objects: 100% (70/70), done.
    remote: Compressing objects: 100% (55/55), done.
    remote: Total 905 (delta 36), reused 37 (delta 15), pack-reused 835
    Receiving objects: 100% (905/905), 654.50 KiB | 0 bytes/s, done.
    Resolving deltas: 100% (565/565), done.
    [todd.musheno@oh-c9q8jv2 purple-mattermost]$ OLD_LANG=$LANG
    [todd.musheno@oh-c9q8jv2 purple-mattermost]$ LANG=en_US.UTF-8
    [todd.musheno@oh-c9q8jv2 purple-mattermost]$ make && make rpm
    Error: You need libmarkdown (discount) development headers installed to be able to compile this plugin
    rm -f FAILNODISCOUNT
    rm -rf /home/todd.musheno/purple-mattermost/rpmdir
    rm -f purple-mattermost.spec
    mkdir -p /home/todd.musheno/purple-mattermost/rpmdir/{BUILD,RPMS,SRPMS,SOURCES,SPECS}
    cp purple-mattermost.spec.in purple-mattermost.spec
    sed -i 's|@PLUGIN_VERSION@|1.1.2019.09.05.git.e21f18c|' purple-mattermost.spec
    tar -czf /home/todd.musheno/purple-mattermost/rpmdir/SOURCES/purple-mattermost-1.1.2019.09.05.git.e21f18c.tar.gz --exclude-vcs --transform 's|^.|purple-mattermost-1.1.2019.09.05.git.e21f18c|' --exclude purple-mattermost-1.1.2019.09.05.git.e21f18c.tar.gz .
    rpmbuild -ta /home/todd.musheno/purple-mattermost/rpmdir/SOURCES/purple-mattermost-1.1.2019.09.05.git.e21f18c.tar.gz --define '_topdir /home/todd.musheno/purple-mattermost/rpmdir'
    error: Failed build dependencies:
    libmarkdown-devel >= 2.1.8 is needed by purple-mattermost-1.1.2019.09.05.git.e21f18c-1.el7.x86_64
    make: *** [rpm] Error 1

Joining a channel from Spectrum2 doesn’t work

When I join a channel from Spectrum2 I’d expect to see the users who are already present there and interact with them.

Instead, first of all there is no discovery or automated invite sent to the user when they first register to the gateway, as well as no information about the format of the mapped JID, and then both mm_join_chat() and mm_chat_info_defaults() don’t get called.

I did modify the g_strsplit_set() call in mm_chat_info_defaults() to avoid using '/' as a separator, which isn’t something representable in the localpart of a JID, but I’m not even sure it’s the way I should interact with the gateway.

In any case, after I join a room, I see myself in it, without any other participant, and shortly after receive a roster push with my nick in the room, which is definitely not something that should happen.

At some point I did receive messages sent from participants in the channel, but as if they were sent to me in private, and it added them to my roster both on XMPP and on the web UI, without me actually doing anything, just after they spoke.

So this whole thing is a mess, I’m probably doing something wrong, but this prpl too. :)

I can attach logs of me doing anything you want if that may help.

Thanks.

SIGABRT 6 on Fedora 25

I built purple-mattermost against pidgin-2.12.0-2.fc25.x86_64 / libpurple-2.12.0-2.fc25.x86_64 on Fedora 25. I could connect and see four channels (Announcements and Chat for the two teams I'm in). Joining Chat worked too, but it looked as if both Chat would go to the same channel. When I tried to write (before hitting enter), pidgin crashed. The automated backtrace is rather vague but I can't get much more information from the abrt logs on my harddrive. Is there anything I could do to help you debug this problem?

code displayed incorrectly: includes html tags

When a post includes code marked in the input with three backticks, it is displayed as a verbatim dump including the < br/ > and &gt; etc., tags that mattermost puts in.
Example:

` ` `
uint64_t x;
return (uint16_t) x>>48;
` ` `

displays as:

<br>uint64_t x;<br>return (uint16_t) x &gt;&gt; 48;<br>

Message with override of "override_username" does not override the display name

When using bots and incoming webhook integrations, it is very useful to override the name displayed as the sender of the message. For the time being, purple-mattermost shows the name of the user generating the webhook integration token, and not the name added to the payload. Example payload (from the debug log):

(09:25:54) mattermost: got frame data:

{
  "event": "posted",
  "data": {
    "channel_display_name": "$channel_name",
    "channel_name": "$channel_name",
    "channel_type": "O",
    "post": "{\"id\":\"$post_id\",\"create_at\":1493709954683,\"update_at\":1493709954683,\"edit_at\":0,\"delete_at\":0,\"is_pinned\":false,\"user_id\":\"$user_id\",\"channel_id\":\"$channel_name\",\"root_id\":\"\",\"parent_id\":\"\",\"original_id\":\"\",\"message\":\":$the_full_message\",\"type\":\"\",\"props\":{\"from_webhook\":\"true\",\"override_icon_url\":\"$our_custom_url\",\"override_username\":\"puppet\"},\"hashtags\":\"\",\"pending_post_id\":\"\"}",
    "sender_name": "puppet",
    "team_id": "$team_id"
  },
  "broadcast": {
    "omit_users": null,
    "user_id": "",
    "channel_id": "$channel_id",
    "team_id": ""
  },
  "seq": 9
}

(In the above case, the username is overridden to show "puppet")

Pidgin however shows the name associated with $user_id; I think the correct behaviour would be to show something like puppet [BOT].

Usability from inside bitlbee: public channels

I recently tried to set up this plugin from inside bitlbee. After poking at it a bit, I was able to get it to connect to a mattermost server. However, while private contacts (i.e. "direct messages" or the equivalent of an IRC /query) seem to have been automatically loaded properly, I can't see any of the public channels that I'm in on the mattermost server.

I'm curious if this is a known problem, and if anyone else has successfully gotten this plugin working from inside bitlbee? When I attempted to connect from inside pidgin, I did automatically get a listing of the public channels I'm in (in addition to the private contacts), so I'm assuming this is just a problem integrating with bitlbee.

Thanks in advance.

Standard emoji from Mattermost to Pidgin render as text, rather than emoji

Summary

Standard emoji from Mattermost to Pidgin render as text, rather than emoji (though standard emoji from Pidgin to Mattermost render as emoji)

Note: This is not an important issue, just creating a ticket as an example of a useful way to file tickets--with clear repro steps and expected/observed.

Steps to reproduce

Post :smile: to a Mattermost channel where a Pidgin client is listening

Expected behavior

:smile: renders as standard emoji, e.g. 😄

Observed behavior

:smile: renders as :smile: instead of emoji

image

Possible fixes

Can the markdown library rendering links also render standard emoji?

Support for Mattermost v4

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.

[Improvement] Annotate a channel with the Mattermost Team

In the current list of channels in pidgin, I don't see what Mattermost Team they belong to. It would be useful to have that information visual (in the channel name).

This could be a on/off flag in settings, for people who only belong to a single team or have no problem differentiating channels from different teams.

free(): invalid pointer in mm_g_free_mattermost_user()

Pidgin 2.12.0 (libpurple 2.12.0)
purple-mattermost: 1.1.2017.10.26.git.d6aa4dd
Mattermost server: 4.2.0
#0  0x00007f9ad3d450d0 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
        set = {__val = {0, 140302974141531, 140725031090640, 0, 140725031207020, 140302955907224, 11, 140725031090608, 140724603453448, 16, 108, 140302976436816, 11, 183919194367405568, 143, 140725031090608}}
        pid = <optimized out>
        tid = <optimized out>
#1  0x00007f9ad3d466b1 in __GI_abort () at abort.c:79
        save_stage = 1
        act = 
          {__sigaction_handler = {sa_handler = 0x7ffd197d3ab8, sa_sigaction = 0x7ffd197d3ab8}, sa_mask = {__val = {140725031090864, 140725031090860, 140725031090880, 6, 2906896664, 94371928324376, 94371928324448, 0, 183919194367405568, 108, 94371927396496, 94371927396496, 4294967295, 1, 140725031090992, 140725031091600}}, sa_flags = 427637552, sa_restorer = 0x1000}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007f9ad3d88427 in __libc_message (action=action@entry=(do_abort | do_backtrace), fmt=fmt@entry=0x7f9ad3e90e38 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:181
        ap = {{gp_offset = 40, fp_offset = 21972, overflow_arg_area = 0x7ffd197d3da0, reg_save_area = 0x7ffd197d3d30}}
        fd = <optimized out>
        list = <optimized out>
        nlist = <optimized out>
        cp = <optimized out>
        written = <optimized out>
#3  0x00007f9ad3d8eb83 in malloc_printerr (action=<optimized out>, str=0x7f9ad3e8d7fa "free(): invalid pointer", ptr=<optimized out>, ar_ptr=<optimized out>) at malloc.c:5411
        buf = "000055d4ae5c0ac0"
        cp = <optimized out>
        ar_ptr = <optimized out>
        ptr = <optimized out>
        str = 0x7f9ad3e8d7fa "free(): invalid pointer"
        action = <optimized out>
#4  0x00007f9ad3d90489 in _int_free (av=0x7f9ad40c3c20 <main_arena>, p=<optimized out>, have_lock=<optimized out>) at malloc.c:4160
        size = <optimized out>
        fb = <optimized out>
        nextchunk = <optimized out>
        nextsize = <optimized out>
        nextinuse = <optimized out>
        prevsize = <optimized out>
        bck = <optimized out>
        fwd = <optimized out>
        errstr = <optimized out>
        locked = <optimized out>
        __func__ = "_int_free"
#5  0x00007f9abf7ac6da in mm_g_free_mattermost_user (a=0x55d4aeb68da0) at libmattermost.c:374
        u = 0x55d4aeb68da0
        a = 0x55d4aeb68da0
        u = 0x55d4aeb68da0
#6  0x00007f9abf7aca09 in mm_response_callback (http_conn=<optimized out>, user_data=0x55d4aeb690d0, url_text=<optimized out>, len=<optimized out>, error_message=0x0) at libmattermost.c:1134
        root = 0x55d4aeb688e0
        body = <optimized out>
        body_len = <optimized out>
        conn = 0x55d4aeb690d0
        parser = 0x55d4ae8a2560 [JsonParser]
#7  0x00007f9ad51d7ed5 in url_fetch_recv_cb (url_data=0x55d4aed41700, source=<optimized out>, cond=cond@entry=PURPLE_INPUT_READ) at util.c:4002
        gfud = 0x55d4aed41700
        len = <optimized out>
        buf = "HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nEtag: 4.2.0.mrbpkxup5pn7fy5mwghtfzba9o.1510322983457.true.true\r\nExpires: 0\r\nX-Request-Id: ddxzxpyy8j86jmcjru4gwwt7ow\r\nX-Version-Id: 4.2.0.4.2.0.60cdb2b"...
        data_cursor = <optimized out>
        got_eof = <optimized out>
        __func__ = "url_fetch_recv_cb"
#8  0x000055d4acb9925e in pidgin_io_invoke (source=<optimized out>, condition=<optimized out>, data=0x55d4aeba4350) at gtkeventloop.c:73
        closure = 0x55d4aeba4350
        purple_cond = PURPLE_INPUT_READ
#9  0x00007f9ad467fe05 in g_main_dispatch (context=0x55d4ad28c580) at gmain.c:3148
        dispatch = 0x7f9ad46c5bf0 <g_io_unix_dispatch>
---Type <return> to continue, or q <return> to quit---
        prev_source = 0x0
        was_in_call = 0
        user_data = 0x55d4aeba4350
        callback = 0x55d4acb99230 <pidgin_io_invoke>
        cb_funcs = 0x7f9ad4946920 <g_source_callback_funcs>
        cb_data = 0x55d4aec220c0
        need_destroy = <optimized out>
        source = 0x55d4aed1f510
        current = 0x55d4ad5bdda0
        i = 1
#10 0x00007f9ad467fe05 in g_main_context_dispatch (context=context@entry=0x55d4ad28c580) at gmain.c:3813
#11 0x00007f9ad46801d0 in g_main_context_iterate (context=0x55d4ad28c580, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3886
        max_priority = 200
        timeout = 0
        some_ready = 1
        nfds = <optimized out>
        allocated_nfds = 42
        fds = 0x55d4ad15e200
#12 0x00007f9ad46804e2 in g_main_loop_run (loop=0x55d4ade9f420) at gmain.c:4082
        __func__ = "g_main_loop_run"
#13 0x00007f9ad621ead7 in IA__gtk_main () at gtkmain.c:1268
        tmp_list = <optimized out>
        functions = 0x0
        init = <optimized out>
        loop = 0x55d4ade9f420
#14 0x000055d4acb60c28 in main (argc=<optimized out>, argv=<optimized out>) at gtkmain.c:941
        opt_force_online = 0
        opt_help = <optimized out>
        opt_login = 0
        opt_nologin = 0
        opt_version = <optimized out>
        opt_si = <optimized out>
        opt_config_dir_arg = <optimized out>
        opt_login_arg = <optimized out>
        opt_session_arg = <optimized out>
        search_path = <optimized out>
        accounts = <optimized out>
        sig_indx = 1
        sigset = {__val = {91142, 0 <repeats 15 times>}}
        errmsg = '\000' <repeats 232 times>...
        signal_channel = <optimized out>
        signal_status = <optimized out>
        signal_channel_watcher = 1
        segfault_message_tmp = <optimized out>
        error = 0x0
        opt = <optimized out>
        gui_check = <optimized out>
        debug_enabled = <optimized out>
        migration_failed = 0
        active_accounts = <optimized out>
        long_options = 
            {{name = 0x55d4acbf9bb1 "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x55d4acbe7ff9 "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x55d4acbf5b94 "force-online", has_arg = 0, flag = 0x0, val = 102}, {name = 0x55d4acbe9b26 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55d4acbf5a3e "login", has_arg = 2, flag = 0x0, val = 108}, {name = 0x55d4acbf5ba1 "multiple", has_arg = 0, flag = 0x0, val = 109}, {name = 0x55d4acbf5baa "nologin", has_arg = 0, flag = 0x0, val = 110}, {name = 0x55d4acbf9ba7 "session", has_arg = 1, flag = 0x0, val = 115}, {name = 0x55d4acbec29d "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55d4acbf9bba "display", has_arg = 1, flag = 0x0, val = 68}, {name = 0x55d4acbf668a "sync", has_arg = 0, flag = 0x0, val = 83}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}

Windows plugin not working

Hello,

I added the mattermost plugin to pidgin. After adding my account i always recieve the error "Bad username/password". We use the latest version of mattermost and when I login with the same credentials using the app they work.

I read some stuff about an older v3 api. Is this plugin still compatible with mattermost?

html formatting breaks text

Pasting a html formatted text breaks something in pidgin/this plugin...

My clipboard:

<span style='font-weight: normal;'><font size="2"><font color="#cc0000">(10:00:05) </font></font></span><span style='font-weight: bold;color: #cc0000;'>Foo: </span>Bar<br><span style='font-weight: normal;'><font size="2"><font color="#cc0000">(10:00:13) </font></font></span><span style='font-weight: bold;color: #cc0000;'>Foo: </span>bar

Debug log:

(10:36:13) GLib: Source ID 489052 was not found when attempting to remove it
(10:36:15) GLib: g_markup_parse_context_parse: assertion 'context->state != STATE_ERROR' failed
(10:36:15) GLib: g_markup_parse_context_end_parse: assertion 'context->state != STATE_ERROR' failed
(10:36:15) mattermost: Fetching url http://mattermost/api/v3/teams/guytssrcpfr8uk4yaxtrsuk7qa/channels/gdyh8mrycin5m86rf1xqmu45sb/posts/create
(10:36:15) mattermost: With postdata {"pending_post_id":"0000C9EAE251FFFF","channel_id":"gdyh8mrycin5m86rf1xqmu45sb","message":"(10:00:05) **Foo: **Bar\n(10:00:13) **Foo: **","user_id":"t674q3id5j8iudtbaa583csn5z","create_at":0}

Note the last "bar" is missing.

To reproduce in linux:

  1. echo "<span style='font-weight: normal;'><font size="2"><font color="#cc0000">(10:00:05) </font></font></span><span style='font-weight: bold;color: #cc0000;'>Foo: </span>Bar<br><span style='font-weight: normal;'><font size="2"><font color="#cc0000">(10:00:13) </font></font></span><span style='font-weight: bold;color: #cc0000;'>Foo: </span>bar" | xclip -selection clipboard -i -t text/html
  2. Paste in chat
  3. Send

Room listing never finishes

Bitlbee never shows the result of the room listing command.
It looks like it is due to each team being counted twice on request, but counted once
on response:

ma->roomlist_team_count++;
// Get a list of public channels the user has *not* yet joined
mmtrl = g_new0(MatterMostTeamRoomlist, 1);
mmtrl->team_id = g_strdup(team_id);
mmtrl->team_desc = g_strdup(_(": More public channels"));
mmtrl->roomlist = roomlist;
url = mm_build_url(ma,"/teams/%s/channels", team_id);
mm_fetch_url(ma, url, MATTERMOST_HTTP_GET, NULL, -1, mm_roomlist_got_list, mmtrl);
g_free(url);
ma->roomlist_team_count++;

ma->roomlist_team_count--;
if (ma->roomlist_team_count <= 0) {
purple_roomlist_set_in_progress(roomlist, FALSE);
ma->roomlist_team_count = 0;
}

I.e. roomlist_set_in_progress is never cleared.

Expired session not noticed.

with gitlab auth when cookie expires we have no indication that we've been disconnected - until trying to send message when we get 'invalid or expired session, please login again'. To reproduce : logout in a mattermost web interface session, observe pidgin.

room/channel history lost

It is possible to write to a subscribed channel and see responses while the window is open. Closing the channel (chat) window and reopening it again will end up in lost history — this is obviously not as desired, contents should be automatically filled in when the room is open (either full history or some period/size, perhaps adjustable in settings). The same happens after pidgin restart - room history is lost.

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.