Results 1 to 15 of 15
  1.    #1  
    I'm trying to integrate the Messaging-Privacy patch with Tweaks. I've tried a few things and need some help. In the dashboardMessage-assistant.jsjsjs $I$ $made$ $this$ $change$ $for$ $the$ $patch$:

    - var conversationText = data.last().message;
    + var conversationText = '[New Message]';

    I'm trying to integrate Tweaks this way. When i do this the messaging app won't open at all and I have to revert the .jsjsjs $file$. $Can$ $anyone$ $help$ $me$ $identify$ $what$ $I$'$m$ $doing$ $wrong$?

    var conversationText = "";

    this.controller.serviceRequest("palm://org.webosinternals.tweaks.prefs/", {
    method: 'get', parameters: {'owner': "messaging-privacy",
    keys: ["privacyEnabled"]},
    onSuccess: function(response) {
    if(response) {
    if(response.privacyEnabled== true){
    conversationText = '[New Message]';
    } else {
    conversationText = data.last().message;
    }
    }
    }.bind(this)});

    Here's the json file:

    [
    {
    "category": "messaging",
    "owner": "messaging-privacy",
    "prefs": [ {
    "group": "behavior",
    "restart": "luna",
    "label": "Enable Privacy",
    "help": "Determines whether message notifications display the message text.",
    "key": "privacyEnabled",
    "type": "ToggleButton",
    "value": false } ]
    }
    ]
    Last edited by peterlemonjello; 05/04/2011 at 01:58 PM.
  2. #2  
    It looks like you didn't code an "onFailure" branch for non-Tweaks users. If you have Tweaks installed then it wouldn't matter though for your test. Did you load up Tweaks first to confirm that Tweaks recognized your Tweak?
  3.    #3  
    Yep, I have Tweaks installed and it recognized the pref in my json file.
  4. #4  
    Code:
    if(response.privateBrowsing == true){
    Shouldn't that be:

    Code:
    if(response.privacyEnabled == true){
    ?
    Want to keep up with my exciting new projects? You know where to find me.
  5. #5  
    Can you post your complete patch file?
  6.    #6  
    Ack, you're right it should be if(response.privacyEnabled == true){

    I have it right in the code but wrong when I pasted it on the post. Nevertheless, the code still doesn't work :-(
  7. #7  
    Quote Originally Posted by peterlemonjello View Post
    Ack, you're right it should be if(response.privacyEnabled == true){

    I have it right in the code but wrong when I pasted it on the post. Nevertheless, the code still doesn't work :-(
    Ah ok. Could we see the patch file? Might help us see what's going wrong.
    Want to keep up with my exciting new projects? You know where to find me.
  8.    #8  
    Quote Originally Posted by appsotutely View Post
    Can you post your complete patch file?
    Sure thing.
    Attached Files Attached Files
    Last edited by peterlemonjello; 05/04/2011 at 02:07 PM.
  9. #9  
    Hmm. This is how I have my Tweaks call set up in my SWW patch:
    Code:
    this.getTweaksPrefs = new Mojo.Service.Request("palm://org.webosinternals.tweaks.prefs/", {
    	method: 'get', parameters: {'owner': "com.choorp.statusbarweatherwidget", 
    	keys: ["weatherUnits","updateInterval","statusLine1","statusLine2","widgetDisplay","clockLocation","iconLaunch"]}, 
    	onSuccess: function(response) {
    		if(response) {
    			if(response.weatherUnits != undefined)
    				this.weatherUnits = response.weatherUnits;
    			if(response.updateInterval != undefined)
    				this.updateFreqInMinutes = response.updateInterval;
    			if(response.statusLine1 != undefined)
    				this.statusLine1 = response.statusLine1;
    			if(response.statusLine2 != undefined)
    				this.statusLine2 = response.statusLine2;
    			if(response.widgetDisplay != undefined)
    				this.widgetDisplay = response.widgetDisplay;
    			if(response.clockLocation != undefined)
    				this.clockDisplay = response.clockLocation;
    			if(response.iconLaunch != undefined)
    				this.iconLaunch = response.iconLaunch;
    		}
    	}.bind(this)});
    Want to keep up with my exciting new projects? You know where to find me.
  10.    #10  
    Hmm, I changed it to this and still not working.
    var conversationText = "";

    this.getTweaksPrefs = new Mojo.Service.Request("palm://org.webosinternals.tweaks.prefs/", {
    method: 'get', parameters: {'owner': "messaging-privacy",
    keys: ["privacyEnabled"]},
    onSuccess: function(response) {
    if(response) {
    if(response.privacyEnabled == true){
    conversationText = '[New Message]';
    } else {
    conversationText = data.last().message;
    }
    }
    }.bind(this)});

    Does it matter where I put the code? Currently it's located in DashboardMessageAssistant.prototype.update = function(isNewContent) {...
  11. #11  
    I just noticed something else in your patch:
    Code:
    --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/
    +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/
    You're missing the filename at the end of both those lines.
    Want to keep up with my exciting new projects? You know where to find me.
  12.    #12  
    Quote Originally Posted by Garrett92C View Post
    I just noticed something else in your patch:
    Code:
    --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/
    +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/
    You're missing the filename at the end of both those lines.
    Yeah, disregard that. I'm not using a patch file. I'm manually making the changes directly to the file then uploading the new file to my Pre+ with Filezilla + a Luna restart. I put that patch file together real quick since appsotutely asked for it.
  13.    #13  
    FWIW, my patch touches two files. Here are the originals and the modified files just in case anyone wants them.
    Attached Files Attached Files
  14. #14  
    I think you may have an issue with asynchronous nature of the Service Request. I think you'll need to have returned from your Service Request by the time you go through that spot in the code. If that's the case, you'll have to move the code around more significantly.
  15.    #15  
    Thanks, I was coming to that conclusion too. I'm not the best javascript coder around so I thought it would be smart to check with some other people.

Posting Permissions