[Pidgin] #10507: add hook to pidgin_notify_formatted()

Pidgin trac at pidgin.im
Tue Oct 13 11:46:56 EDT 2009


#10507: add hook to pidgin_notify_formatted()
------------------+---------------------------------------------------------
Reporter:  jts    |        Type:  enhancement 
  Status:  new    |   Component:  pidgin (gtk)
 Version:  2.6.2  |    Keywords:              
------------------+---------------------------------------------------------
 i'd like for one of my plugins to have the ability to respond to XMPP
 headline messages, which appear in the dialog created by
 pidgin_notify_formatted(). this patch provides a hook for a plugin to
 modify the dialog before the user sees it. in addition to my particular
 need, it seems it could be useful for other things as well.

 {{{
 --- gtknotify.c 2009/10/11 21:18:28     1.1
 +++ gtknotify.c 2009/10/13 14:45:56
 @@ -830,6 +830,8 @@
         return options;
  }

 +void (*pidgin_notify_formatted_hook)() = NULL;
 +
  static void *
  pidgin_notify_formatted(const char *title, const char *primary,
                                                   const char *secondary,
 const char *text)
 @@ -883,6 +885,9 @@
         gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
         gtk_widget_show(frame);

 +       if (pidgin_notify_formatted_hook)
 +               (*pidgin_notify_formatted_hook)(window, title, primary,
 secondary, text);
 +
         /* Add the Close button. */
         button = gtk_dialog_add_button(GTK_DIALOG(window),
 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
         gtk_widget_grab_focus(button);

 }}}

-- 
Ticket URL: <http://developer.pidgin.im/ticket/10507>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list