sardemff7 / purple-libnotify-plus

Provide libnotify interface to Pidgin and Finch, inspired by Pidgin-libnotify and Guifications
GNU General Public License v3.0
21 stars 9 forks source link

Had to patch purple-libnotify+-utils.c to compile #1

Closed UnitedMarsupials-zz closed 12 years ago

UnitedMarsupials-zz commented 12 years ago

While creating a FreeBSD port of your extension, I had to patch it to build against the version of libnotify installed by FreeBSD's devel/libnotify port (the first two hunks), and to add const-ification (the last hunk). Please, consider this for your next release. Thank you!

--- src/purple-libnotify+-utils.c       2011-10-29 17:03:41.000000000 -0400
+++ src/purple-libnotify+-utils.c       2012-02-29 13:59:30.000000000 -0500
@@ -22,7 +22,4 @@

 #include <libnotify/notify.h>
-#if ! NOTIFY_CHECK_VERSION(0,7,0)
-#include "libnotify-compat.h"
-#endif

 #include "purple-libnotify+-utils.h"
@@ -183,5 +180,5 @@
        }

-       notification = notify_notification_new(title, es_body, NULL);
+       notification = notify_notification_new(title, es_body, NULL, NULL);

        g_free(es_body);
@@ -199,6 +196,6 @@
                GdkPixbuf *protocol_icon = NULL;
                PurplePluginProtocolInfo *info;
-               gchar *protoname = NULL;
-               gchar *filename = NULL;
+               const gchar *protoname = NULL;
+               const gchar *filename = NULL;

                buddy_icon = purple_buddy_get_icon(buddy);
UnitedMarsupials-zz commented 12 years ago

Err, never mind. Turns out, my install of libnotify was out of date. The first two hunks above are only needed for libnotify-0.5.2

The last hunk, which adds constification, is still required for a clean compile, however:

--- src/purple-libnotify+-utils.c       2011-10-29 17:03:41.000000000 -0400
+++ src/purple-libnotify+-utils.c       2012-02-29 13:59:30.000000000 -0500
@@ -199,6 +196,6 @@
                GdkPixbuf *protocol_icon = NULL;
                PurplePluginProtocolInfo *info;
-               gchar *protoname = NULL;
-               gchar *filename = NULL;
+               const gchar *protoname = NULL;
+               const gchar *filename = NULL;

                buddy_icon = purple_buddy_get_icon(buddy);
sardemff7 commented 12 years ago

Thanks for the report.

I have done some work on this part of the code recently, I think the const-ification part is now ok. I released the 1.4.90 with these changes. Regarding the libnotify compat code, could you test the following patch? With yours, I lose the libnotify >= 0.7 compatibility and I would love to avoid that.

diff --git a/src/libnotify-compat.h b/src/libnotify-compat.h
index b5bcd1e..a3eb945 100644
--- a/src/libnotify-compat.h
+++ b/src/libnotify-compat.h
@@ -23,6 +23,12 @@
 #ifndef __EVENTD_PLUGINS_NOTIFY_COMPAT_H__
 #define __EVENTD_PLUGINS_NOTIFY_COMPAT_H__

+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(a,b,c) (0)
+#endif
+
+#if ! NOTIFY_CHECK_VERSION(0,7,0)
 #define notify_notification_new(summary, body, icon) notify_notification_new(summary, body, icon, NULL)
+#endif

 #endif /* __EVENTD_PLUGINS_NOTIFY_COMPAT_H__ */
diff --git a/src/purple-libnotify+-utils.c b/src/purple-libnotify+-utils.c
index dfcc234..3db0169 100644
--- a/src/purple-libnotify+-utils.c
+++ b/src/purple-libnotify+-utils.c
@@ -21,9 +21,7 @@
 #include "purple-libnotify+-common.h"

 #include <libnotify/notify.h>
-#if ! NOTIFY_CHECK_VERSION(0,7,0)
 #include "libnotify-compat.h"
-#endif

 #include "purple-libnotify+-utils.h"
UnitedMarsupials-zz commented 12 years ago

There is no src/libnotify-compat.h in the 1.2.91 -- the most recent release available :-)

sardemff7 commented 12 years ago

Oh, nice catch. That should be fixed in 1.4.91.

Did you test the 1.4.90 release (and the 1.4.91 now) regarding the other problem?

sardemff7 commented 12 years ago

Any news?

UnitedMarsupials-zz commented 12 years ago

On 11.03.2012 08:35, Quentin Glidic wrote:

Any news? No, sorry -- other priorities :(

I looked into libnotify-plus, because I could not figure out, how to be notified of new messages in a chat-room. New IMs sent to me directly cause notifications, but new traffic in a chat-room only causes the chatroom's title to become red. Which means, I don't see it, unless pidgin's window is visible already.

I was hoping, libnotify-plus would have an option for that, but it does not either, it seems...

-mi
sardemff7 commented 12 years ago

It has this feature, but I think I limited it to people you have in your buddy list. You can file a bug/feature request to improve this, I’ll look at it later.

I close this issue as it should be fixed now.

UnitedMarsupials-zz commented 12 years ago

On 11.03.2012 10:09, Quentin Glidic wrote:

It has this feature, but I think I limited it to people you have in your buddy list. You can file a bug/feature request to improve this, I’ll look at it later. I think, I enabled all available notifications in the libnotify-plus settings, but still was not getting notices of new messages in a chat-room. Both of the other two participants were my "buddies".

-mi