Know when unviewed tab is clicked in protocol plugin

Zachary West zacw at adium.im
Tue Sep 21 11:27:17 UTC 2010


On Fri, Sep 10, 2010 at 22:22, Chase Sechrist <chase at sechrist.net> wrote:
> Hi,
> I'm developing a protocol plugin and it's important for my purple C code to
> know when I click on a tab in a chat window that previously had unviewed
> content. Is it possible to get an event to notify my purple plugin, like
> back to a PurpleConversation or a PurpleBuddy?
> Thanks,
> --
> Chase Sechrist
>

Inside your wrapper to get the libpurple function to load, you'd
likely need to add some objective-C support code to get this to work
with Adium.

Adium posts the NSNotification Chat_BecameActive whenever a chat
becomes active. At this point, (and only this point; it's cleared in
the next run loop) the [chat unviewedContentCount] will return the
number of unread messages previously in the chat.

You can get the PurpleConversation for the AIChat by using the [[chat
identifier] pointerValue], which (if non-NULL) is the
PurpleConversation.

I do not believe this will be possible in straight C just interacting
with libpurple, however.

-- 
Zachary West




More information about the devel mailing list