plugin: hidden conversation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

plugin: hidden conversation

Markus Teich
Heyho,

I am currently writing a plugin which needs to exchange metadata-messages
between pairs of participants in a chat. I figured out how to hide those
messages so they won't bother the user, but I was not able to find a way to
prevent pidgin from spawning a new tab in the conversation window.

Currently in the "chat-buddy-joined" handler I try to find an existing
conversation with the respective user with
`purple_find_conversation_with_account` and in case there is none yet, I create
it `with purple_conversation_new`. Then I use `purple_conv_im_send_with_flags`
using the PURPLE_MESSAGE_INVISIBLE flag to send the first metadata-message. Can
I prevent popping up a convesation tab/window in the GTK frontend for the sender
AND receiver?

I'm using pidgin v2.11.0.

--Markus

_______________________________________________
Devel mailing list
[hidden email]
https://pidgin.im/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: plugin: hidden conversation

Eion Robb-3
Hi Markus,

Pidgin has the concept of a 'hidden conversation window' that it uses for conversation that you've hidden (eg, you've marked a chat as persistent in the buddy list, then closed the conversation window) - looking through pidgin/gtkconv.c shows some other cases of when the conversation is added to the hidden conversation window.

Unfortunately there's no public api that would let you move a conversation to the hidden conversation window, but messing around with the "/conversations/im/hide_new" setting may let you change where the conversation ends up when the received-im-msg is fired when your particular message is received.

Is your source code online anywhere?  Sounds like an interesting plugin and I'd love to take a look :)

Cheers,
Eion

On 2 March 2017 at 01:43, Markus Teich <[hidden email]> wrote:
Heyho,

I am currently writing a plugin which needs to exchange metadata-messages
between pairs of participants in a chat. I figured out how to hide those
messages so they won't bother the user, but I was not able to find a way to
prevent pidgin from spawning a new tab in the conversation window.

Currently in the "chat-buddy-joined" handler I try to find an existing
conversation with the respective user with
`purple_find_conversation_with_account` and in case there is none yet, I create
it `with purple_conversation_new`. Then I use `purple_conv_im_send_with_flags`
using the PURPLE_MESSAGE_INVISIBLE flag to send the first metadata-message. Can
I prevent popping up a convesation tab/window in the GTK frontend for the sender
AND receiver?

I'm using pidgin v2.11.0.

--Markus

_______________________________________________
Devel mailing list
[hidden email]
https://pidgin.im/cgi-bin/mailman/listinfo/devel


_______________________________________________
Devel mailing list
[hidden email]
https://pidgin.im/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: plugin: hidden conversation

Markus Teich
Heyho Eion,

Eion Robb wrote:

> Pidgin has the concept of a 'hidden conversation window' that it uses for
> conversation that you've hidden (eg, you've marked a chat as persistent in the
> buddy list, then closed the conversation window) - looking through
> pidgin/gtkconv.c shows some other cases of when the conversation is added to
> the hidden conversation window.
>
> Unfortunately there's no public api that would let you move a conversation to
> the hidden conversation window, but messing around with the
> "/conversations/im/hide_new" setting may let you change where the conversation
> ends up when the received-im-msg is fired when your particular message is
> received.

Thanks for the hint! Until now I only looked at the libpurple interface, but
with pidgin code it might be solveable. I also thought about using the
set_ui_ops call to override some of the internal handlers of the conversation,
but that is probably harder to maintain when there is a new version of pidgin
available. I'll test around a bit and let you know when I have an update.

> Is your source code online anywhere?  Sounds like an interesting plugin and
> I'd love to take a look :)

Sure, the current plugin code is available at [0], but I've only just begun, so
not much code yet. It's supposed to become a viable OTR-like plugin but for
group chats. I already did the crypto stuff which is available as libgotr at [1]
(including some presentation slides).

Have a great day!

--Markus


0: https://github.com/schachmat/pidgotr
1: https://github.com/schachmat/gotr

_______________________________________________
Devel mailing list
[hidden email]
https://pidgin.im/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: plugin: hidden conversation

Markus Teich
Markus Teich wrote:
> I'll test around a bit and let you know when I have an update.

Heyho Eion,

Your "/conversations/im/hide_new" setting hint actually worked very well and I
adapted it into the plugin[0], so thanks! It is now possible to exchange
repudiable, encrypted messages in jabber chat rooms with pidgin. I am continuing
the plugin work with per-message icons so users can see which messages have been
encrypted.

--Markus


0: https://github.com/schachmat/pidgotr/blob/master/pidgin-gotr.c#L125

_______________________________________________
Devel mailing list
[hidden email]
https://pidgin.im/cgi-bin/mailman/listinfo/devel