diff options
author | Izhar Firdaus <izhar@inigo-tech.com> | 2011-04-13 01:05:31 +0800 |
---|---|---|
committer | Izhar Firdaus <izhar@inigo-tech.com> | 2011-04-13 01:05:31 +0800 |
commit | 21690298e8b97223ba4b9239460b77078a9b669c (patch) | |
tree | 9dbfcc8129bca8e9a09900fe98adf487a174efa2 | |
parent | 458704dc881997b7847013586809a709fadd6e7a (diff) | |
download | hack-patches-21690298e8b97223ba4b9239460b77078a9b669c.tar.gz hack-patches-21690298e8b97223ba4b9239460b77078a9b669c.tar.xz hack-patches-21690298e8b97223ba4b9239460b77078a9b669c.zip |
* added DEBUG variable which turn debugging on/off
* set default buddy icon as pidgin icon, use it if theres no icon available
for buddy
-rw-r--r-- | gnomeshell@pidgin.im/extension.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gnomeshell@pidgin.im/extension.js b/gnomeshell@pidgin.im/extension.js index 9a69c6b..7a9f0c7 100644 --- a/gnomeshell@pidgin.im/extension.js +++ b/gnomeshell@pidgin.im/extension.js @@ -24,6 +24,8 @@ const TelepathyClient = imports.ui.telepathyClient; const _ = Gettext.gettext; +const DEBUG=true; + function wrappedText(text, sender, timestamp, direction) { return { messageType: Tp.ChannelTextMessageType.NORMAL, @@ -57,7 +59,7 @@ Source.prototype = { this._account = account; this._conversation = conversation; this._initialMessage = initialMessage; - this._iconUri = null; + this._iconUri = 'file:///usr/share/icons/hicolor/48x48/apps/pidgin.png'; // use this icon as default this._presence = 'online'; this._notification = new TelepathyClient.Notification(this); this._notification.setUrgency(MessageTray.Urgency.HIGH); @@ -70,10 +72,12 @@ Source.prototype = { this._initialMessage = proxy.PurpleConversationMessageGetMessageSync(messageobj); } }; - - this._iconUri = 'file://' + proxy.PurpleBuddyIconGetFullPathSync(proxy.PurpleBuddyGetIconSync(this._author_buddy)); + + let iconobj = proxy.PurpleBuddyGetIconSync(this._author_buddy); - global.log(this._iconUri); + if (iconobj) { + this._iconUri = 'file://' + proxy.PurpleBuddyIconGetFullPathSync(iconobj); + }; // Start! // @@ -266,9 +270,11 @@ function patchSynchronousMethods(obj, iface) { let name = method.name + 'Sync'; obj[name] = function () { let arg_array = Array.prototype.slice.call(arguments); - logmsg = 'calling ' + method.name + ' with parameters ' + arg_array + ' arguments ' + arguments; - log(logmsg); - global.log(logmsg); + let logmsg = 'calling ' + method.name + ' with parameters ' + arg_array + ' arguments ' + arguments; + if (DEBUG) { + log(logmsg); + global.log(logmsg); + } return obj._dbusBus.call( obj._dbusBusName, obj._dbusPath, |