Coder Social home page Coder Social logo

sardemff7 / purple-events Goto Github PK

View Code? Open in Web Editor NEW
13.0 6.0 3.0 76 KB

libpurple events handling plugin and library

License: GNU General Public License v3.0

C 92.89% Vala 2.57% Meson 4.55%
libpurple purple-events libpurple-plugin events user-config pidgin

purple-events's Introduction

purple-events

purple-events allows a fine-grained control over libpurple events (buddy signing on, new message).  It does not dispatch any event to any system, a dispatching plugin is needed.

Dependencies

  • libpurple 2.6.0 (or newer)

Releases

Visit the tags page to find releases tarball.

Licence

purple-events is licenced under the terms of the GNU General Public License version 3

Author / Contact

Morgane “Sardem FF7” Glidic ([email protected]) — My other Free Software projects

purple-events's People

Contributors

lighterowl avatar sardemff7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

purple-events's Issues

No compilation/configuration options

There is no infrastructure to compile this library, which is required by purple-libnotify-plus.

I had no idea it was so hard just to get a stupid libnotify event.

pidgin-2.10.6 crashes when receiving a displaying-emails-notification event with NULL parameters

Environment: Gentoo ~amd64, pidgin-2.10.6, purple-events-9999

Problem:

Pidgin sometimes crash with SEGSEGV. Analyzing with gdb reveals purple_events_callback_emails_notification() is called with count = 1, but subject, from, to, and url are all NULL pointers. A bug inside Pidgin itself?

My workaround:

--- src/plugin/callbacks.old.c  2012-08-27 09:30:26.480006829 +0800
+++ src/plugin/callbacks.c      2012-08-27 09:31:41.040007073 +0800
@@ -407,6 +407,9 @@
     if ( ! purple_prefs_get_bool("/plugins/core/events/restrictions/stack-emails") )
         count = 1;

+    if (!subject || !from || !to || !url)
+        return;
+
     PurpleEventsHandler *handler;
     GList *handler_;
     guint i;

Update: Oops, didn't realize there's a place in the function that unconditionally sets count to 1. Silly me.

src/plugin/callbacks.c, line 407:

     if ( ! purple_prefs_get_bool("/plugins/core/events/restrictions/stack-emails") )
         count = 1;

This might be the cause. It should check if count is 0 before setting it to 1 unconditionally. Couldn't reproduce the issue now so no way to test, though.

Update #2: Correct fix should be:

--- src/plugin/callbacks.old.c  2012-08-27 21:29:22.978508096 +0800
+++ src/plugin/callbacks.c      2012-08-27 21:30:02.178508167 +0800
@@ -404,7 +404,7 @@
     if ( ! purple_prefs_get_bool("/plugins/core/events/events/emails") )
         return;

-    if ( ! purple_prefs_get_bool("/plugins/core/events/restrictions/stack-emails") )
+    if ( count && ! purple_prefs_get_bool("/plugins/core/events/restrictions/stack-emails") )
         count = 1;

     PurpleEventsHandler *handler;

pidgin crashes when disabling logging

Procedure to reproduce, tested with pidgin 2.10.9, purple-events 0.2 on Sabayon with XMPP:

  1. Add a MUC-chat.
  2. Enter the chat.
  3. Disable logging.
  4. Quit Pidgin.
  5. Pidgin crashes at startup. (Sometimes it already crashes at 3) or 4))

Crash does not appear when plugin purple-events is disabled. Thats the reason I file the bug here and not over at pidgin. All other plugins were disabled, backtrace is here:

#0  0x00007ffff47a6945 in malloc_consolidate () from /lib64/libc.so.6
No symbol table info available.
#1  0x00007ffff47a7be4 in _int_malloc () from /lib64/libc.so.6
No symbol table info available.
#2  0x00007ffff47aa8c4 in calloc () from /lib64/libc.so.6
No symbol table info available.
#3  0x00007ffff5044909 in g_malloc0 () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#4  0x00007ffff502d980 in ?? () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#5  0x00007ffff502dfca in ?? () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#6  0x00007ffff5d5af12 in purple_dbus_unregister_pointer (node=0xc9d560) at dbus-server.c:119
        id = 0x1a13
#7  0x00007ffff5d3ddfa in purple_status_destroy (status=0xc9d560) at status.c:602
No locals.
#8  0x00007ffff503b3fd in g_list_foreach () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#9  0x00007ffff5d3f6d2 in purple_presence_destroy (presence=0xc9c3d0) at status.c:1179
        __PRETTY_FUNCTION__ = "purple_presence_destroy"
#10 0x00007ffff5cf3376 in purple_buddy_destroy (buddy=0xc9c340) at blist.c:1412
        prpl = <optimized out>
        prpl_info = <optimized out>
#11 0x00007ffff5cf4bf9 in purple_blist_node_destroy (node=0xc9c210) at blist.c:2862
        ui_ops = 0x6f09e0 <blist_ui_ops>
        child = <optimized out>
        next_child = 0x0
#12 0x00007ffff5cf4bf9 in purple_blist_node_destroy (node=0xb52b80) at blist.c:2862
        ui_ops = 0x6f09e0 <blist_ui_ops>
        child = <optimized out>
        next_child = 0xc9dab0
#13 0x00007ffff5cf8d09 in purple_blist_uninit () at blist.c:3252
        node = 0x26808f0
        next_node = 0xcdb510
#14 0x00007ffff5d084da in purple_core_quit () at core.c:227
        ops = <optimized out>
        core = 0x7e83e0
        __PRETTY_FUNCTION__ = "purple_core_quit"
#15 0x00007ffff5532f60 in g_closure_invoke () from /usr/lib64/libgobject-2.0.so.0
No symbol table info available.
#16 0x00007ffff5545070 in ?? () from /usr/lib64/libgobject-2.0.so.0
No symbol table info available.
#17 0x00007ffff554ce66 in g_signal_emit_valist () from /usr/lib64/libgobject-2.0.so.0
No symbol table info available.
#18 0x00007ffff554d072 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
No symbol table info available.
#19 0x00007ffff6e8ce8c in gtk_widget_activate () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#20 0x00007ffff6d8830d in gtk_menu_shell_activate_item () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#21 0x00007ffff6d886ac in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#22 0x00007ffff6d756e9 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#23 0x00007ffff5532f60 in g_closure_invoke () from /usr/lib64/libgobject-2.0.so.0
No symbol table info available.
#24 0x00007ffff5544d5b in ?? () from /usr/lib64/libgobject-2.0.so.0
No symbol table info available.
#25 0x00007ffff554ca8f in g_signal_emit_valist () from /usr/lib64/libgobject-2.0.so.0
No symbol table info available.
#26 0x00007ffff554d072 in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
No symbol table info available.
#27 0x00007ffff6e8dc5e in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#28 0x00007ffff6d73a54 in gtk_propagate_event () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#29 0x00007ffff6d73dbb in gtk_main_do_event () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#30 0x00007ffff69e359c in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
No symbol table info available.
#31 0x00007ffff503eb55 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#32 0x00007ffff503ee98 in ?? () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#33 0x00007ffff503f2fa in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
No symbol table info available.
#34 0x00007ffff6d72db7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#35 0x0000000000434fd1 in main (argc=1, argv=0x7fffffffd588) at gtkmain.c:933
        opt_force_online = 0
        opt_help = <optimized out>
        opt_login = 0
        opt_nologin = 0
        opt_version = <optimized out>
        opt_si = 0
        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 = {82950, 0 <repeats 15 times>}}
        errmsg = "\020\000\000\000\000\000\000\000\362\373z\364\377\177\000\000\000\000\000\000\000\000\000\000\240ZQ\356\377\177\000\000\240\304\377\377\377\177\000\000\237u\244\360\377\177\000\000/usr/bin/pidgin", '\000' <repeats 633 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 = <optimized out>
        active_accounts = <optimized out>
        st = {st_dev = 4222451713, st_ino = 140737488340128, st_nlink = 140737488340128, st_mode = 4294952096, st_uid = 32767, st_gid = 4294952096, __pad0 = 32767, st_rdev = 140737488340143, st_size = 140737488344223, 
          st_blksize = 140737488340128, st_blocks = 140737488344223, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0, tv_nsec = 16}, __unused = {140737295088626, 140737298366464, 0}}
        long_options = {{name = 0x4d2d7c "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x4bd02e "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x4ce163 "force-online", has_arg = 0, flag = 0x0, val = 102}, {
            name = 0x4c06df "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x4ce02a "login", has_arg = 2, flag = 0x0, val = 108}, {name = 0x4ce170 "multiple", has_arg = 0, flag = 0x0, val = 109}, {name = 0x4ce179 "nologin", 
            has_arg = 0, flag = 0x0, val = 110}, {name = 0x4d2d72 "session", has_arg = 1, flag = 0x0, val = 115}, {name = 0x4c43db "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x4d2d85 "display", has_arg = 1, flag = 0x0, 
            val = 68}, {name = 0x4cf666 "sync", has_arg = 0, flag = 0x0, val = 83}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}

pidgin-2.10.6 crashes on exit with purple-events (git version)

Environment: Gentoo ~amd64, pidgin-2.10.6, purple-events-9999

Problem:

Exiting Pidgin (after it has connected to some accounts?) results in:

*** glibc detected *** /usr/bin/pidgin: free(): invalid pointer: 0x0000555556478db0 ***
======= Backtrace: =========
...

Possible cause:

Line 214, src/plugin/events.c:

static gboolean
_purple_events_unload(PurplePlugin *plugin)
{
    // ...

    g_list_free_full(context->just_signed_on_accounts, _purple_events_just_signed_on_account_free);

    // ...

Line 202, src/plugin/events.c:

static void
_purple_events_just_signed_on_account_free(gpointer data)
{
    // ...

    g_free(just_signed_on_account);
}

g_list_free_full will call g_free on elements in the GList after it fires the callback function, so calling gfree to free an element on _purple_events_just_signed_on_account_free may introduce a double free, according to my very limited understanding of glib.

Proposed patch:

--- src/plugin/events.old.c 2012-08-27 10:04:03.130013469 +0800
+++ src/plugin/events.c 2012-08-27 10:03:33.840013373 +0800
@@ -195,11 +195,10 @@
 }

 static void
-_purple_events_just_signed_on_account_free(gpointer data)
+_purple_events_just_signed_on_account_free(gpointer data, gpointer user_data)
 {
     PurpleEventsJustSignedOnAccount *just_signed_on_account = data;
     purple_timeout_remove(just_signed_on_account->handle);
-    g_free(just_signed_on_account);
 }

 static gboolean

Missing po/Makefile.in

When running configure, I'm getting an error that po/Makefile.in is missing. Is it missing from the source tree?

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.