[gnome-packagekit] Ignore message types we do not recognize. Fixes rh#575669



commit d4648c585cacaa962d1a05937f53a831e39d9904
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jul 2 08:55:26 2010 +0100

    Ignore message types we do not recognize. Fixes rh#575669
    
    If the daemon was built later than the client tools, the daemon
    could send message types that the client does not recognize, and
    does not have translations for. In this case ignore the message, as
    we don't have anything useful (other than the enum number) to show
    in the UI.
    
    This should stop the message icon appearing and the when the user
    clicks on it, they find the message is missing.
    
    Thanks to Jcarr for debugging.

 src/gpk-watch.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index ed14b90..22330a4 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -1319,6 +1319,12 @@ gpk_watch_process_messages_cb (PkMessage *item, GpkWatch *watch)
 		      "details", &details,
 		      NULL);
 
+	/* this is message unrecognised */
+	if (gpk_message_enum_to_localised_text (type) == NULL) {
+		egg_warning ("message unrecognized, and thus ignored: %i", type);
+		goto out;
+	}
+
 	/* is ignored */
 	ret = gpk_watch_is_message_ignored (watch, type);
 	if (ret) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]