Patch Messaging New Cards For Each Conversation

From WebOS Internals
Revision as of 00:25, 22 July 2009 by Hopspitfire (talk | contribs)
Jump to navigation Jump to search

The message app can be a pain when you have multiple conversations going on. You have to swipe back and then pick someone else quite often. It gets annoying. This modification makes it so a new card is created whenever you click into a conversation.

Edit /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js We are going to replace the launchChatView function with the following...

launchChatView: function(chatThreadId) {
	//Need to jump to that stage if it exists
	var stageController = Mojo.Controller.appController.getStageController("messaging"+chatThreadId);
		if (stageController) {
			stageController.activate();
			return;
		}

	var params = {name: 'messaging' + chatThreadId,
			lightweight: Mojo.Controller.appInfo.lwStages
	};

	var callback = function(controller) {
		controller.pushScene('chatview',chatThreadId,{
					focusWindow: true
				});		
	};

	Mojo.Controller.getAppController().createStageWithCallback(params, callback); //doesnt create ifit exists sooo
  },
  
  clearListBadgeForChatThreadId: function(chatThreadId) {
	var badgeContainers = ["buddyBageContainer","historyBageContainer"];
	var listItem;
	for (var i = 0; i < badgeContainers.length; i++) {
		listItem = this.controller.get(badgeContainers[i] + chatThreadId);
		if (listItem && !listItem.hasClassName('hide-unread-count')) {
			listItem.addClassName('hide-unread-count');
		}
	}	
  }, 

Now in /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js Comment out lines 246 and 247. This will make it so if you back gesture in a chat, then it doesn't bring you back to the conversation list or do anything else.

Concerns

There's some delay in creating the new cards. I'm not sure why though.

Unread message counter in listview doesn't always update when you view a conversation.

Major Bugs

None yet

Enjoy! -Mike dg


  • verified by tictac (after a few miscues)