Compatibility out of the box

My current boss wanted to know if the LiveScratcher Script-to-DUI interface would work with Windows Live Messenger 8 too. I’d kept in mind that I wanted it compatible with WLM8, but hadn’t tested it yet. To my suprise, there were only two tiny (non-fatal) errors, and I could get the advertising removal script working with just one extra line.

Behold, the Windows Live Messenger 8 *and* 9 compatible advertisement patch:

//Compact method
function CL_onCreatedElement(resid, root) {
	if (resid=="mainContentResID") {
		var ads=root.FindDescendent("TabsAndAds") || root.FindDescendent("AdBanner");
		ads.LayoutPos=-3;
	}
}

//Verbose method
function Convo_onCreatedElement(resid, root) {
	if (resid=="convframeresid") {
		var adbannergutter=root.FindDescendent("adbannergutter");
		if (adbannergutter)
			adbannergutter.SetValue("LayoutPos",Value.CreateInt(-3));
	}
}

//Patches contained in this file
Patches=[
	{
		id: "ContactListAdvert",
		name: "Remove Contact-list Advertisement",
		version: "1.0",
		author: "A. Nonymous",
		website: "http://www.google.com/",
		onCreatedElement: CL_onCreatedElement
	},
	{
		id: "ConvoTextAdvert",
		name: "Remove Conversation Text Advertising",
		version: "1.0",
		author: "A. Nonymous",
		website: "http://www.google.com/",
		onCreatedElement: Convo_onCreatedElement
	}
];
//Register patches
for (var i in Patches) {
	RegisterPatch(Patches[i].id,Patches[i]);
}

The whole thing started off as an extension to a DUI compatibility layer I wrote for Iminent, but with every hour I stick in I’m falling in love with it more 🙂

What if…

… You could write Messenger patches in JavaScript? I guess it could look something like this:

function CL_onCreatedElement(resid, root) {
	if (resid=="mainContentResID") {
		var TabsAndAds=root.FindDescendent("TabsAndAds");
		if (TabsAndAds)
			TabsAndAds.SetValue("LayoutPos",new Value(-3));
	}
}

function Convo_onCreatedElement(resid, root) {
	if (resid=="convframeresid") {
		var adbannergutter=root.FindDescendent("adbannergutter");
		if (adbannergutter)
			adbannergutter.SetValue("LayoutPos",-3);
	}
}

//Patches contained in this file
Patches=[
	{
		id: "ContactListAdvert",
		name: "Remove Contact-list Advertisement",
		version: "1.0",
		author: "A. Nonymous",
		website: "http://www.google.com/",
		onCreatedElement: CL_onCreatedElement
	},
	{
		id: "ConvoTextAdvert",
		name: "Remove Conversation Text Advertising",
		version: "1.0",
		author: "A. Nonymous",
		website: "http://www.google.com/",
		onCreatedElement: Convo_onCreatedElement
	}
];
//Register patches
for (var i in Patches) {
	RegisterPatch(Patches[i].id,Patches[i]);
}

The above code works just like you’d expect it to, thanks to a new project I’m working on. For now it features only a very very small subset of the DirectUI library, just enough to make the above work (+ some debugging, obviously), but I plan to expand it to create an incredibly flexible platform for writing patches, skins, and later maybe even plugins.

It’s the spiritual successor of the abandoned Project M or Modumes project. Basically Project M was too complex, by using Windows JScript and allowing any other language to write modules in, I faced some problems (mainly threading) that I could not reliable fix.

To create something that could reliable interface with the DirectUI, I needed to have an enviroment where everything, or at least the parts interfacing with DirectUI, would be running from the main thread. My eye first fell on LUA, later on Squirrel, but in the end I figured that although those two scripting languages were incredibly powerful and small, I wanted something a tad more manageable. Eventually I figured the best language would be JavaScript, and Google’s V8 Engine allowed me all I needed:

  • Quick execution (although Mozilla’s TraceMonkey is apparently slightly faster, V8 does a really good job, and was easier to embed)
  • Easy embedding
  • Easy extensible (adding new objects)
  • Easy to learn (Plus! uses a variant of JavaScript too, and all client-side web development is JavaScript too)
  • No threading issues

A weekend plus several hours in the evenings further, and I have a working prototype, yay! 🙂

My current goals:

  • Ability to write quick patches
    • Without having to replace the entire UIB/XML
    • Without having to convert back and forth from UIB
    • Without having to update for each and every minor update
  • Ability to bind to element events (e.g. onMouseOver, onClick)
  • Ability to interface with the Messenger API
  • Ability to set timers from patches
  • Ability to interface with outside programs
  • Ability to share functions between scripts

Messenger Addons

Since the new version of Messenger 9, none of the major Messenger add-ons have been updated to support it: I myself have attempted to port the current StuffPlug 3 code to WLM9, but concluded that there have been so many changes that for it to be fully compatible I’d have to do a re-write. Patchou had made a quick beta compatible with the earlier WLM9 beta, but he hasn’t posted anything on his own forums since December, and as far as I know his latest version of Plus! is not compatible with the (January released) WLM9 Release Candidate. Messenger Discovery only states “limited support for 9.0”, and to top it all off all current patches (with the notable exception of A-patch, who did a limited version) are not compatible with the new messenger file format.

Basically I think that the comment absorbation made on my earlier post was probably dead on: everyone seems to have moved on to other projects. I’ve seen my own interest in Messenger getting lower at times, resulting in no updates for StuffPlug, but now it’s not only me: even Patchou, the one person who’s kept updating Plus! for ages even when SP and MD would not, seems to be moving on to other projects.

I sometimes wonder how it is that old developers are moving on while no new ones are taking any interest in Messenger anymore. Is messenger development going too slow? too fast? is it because they completely abandoned all the APIs available? Is it because the messenger team has been more and more secretive, and the only real outwards communication being mainly focused on normal users while no longer appealing to developers? I’d really love to hear people’s opinions on this, and would be especially interested in hearing what people at Microsoft think of it. Please, if you read this and have any thoughts about this subject at all, share them with us through the comments below.

On a slightly different note, I’d like to comment on what warmth said in reply to an earlier post. Yes, StuffPlug currently is pretty much dead: the code I have is just no longer compatible with the changes in WLM9, and I’d have to start a re-write sometime. Problem is that most of StuffPlug’s features aren’t really relevant anymore on Messenger 9, and so trying to re-write the entire beast for WLM9 won’t really get me anywhere. I’d much rather start off with something small and build it up from there, much like StuffPlug was in the beginning. So if you have anything, anything at all, that bothers you about Messenger 9, please do tell me, and it might spark that required bit of passion to start working on something again.

As for helping development of other projects; I have actually helped and contributed to both Plus! and MD in the past, and if I can help them again I’d still love to, but setting up an environment for different people to work on the same (hobby) project takes time and effort, and I’m not sure either of us are really ready to make that kind of effort.

So, if you read this: please do leave a comment if you have any views on the whole lack of third-party development on Messenger 9, or if you have something that you’d like to see changed in Messenger 9 by a third-party add-on.

Atheism gone mad

I know most of the previous posts have been technical, but I started this blog as something where I just write anything that I felt like sharing. That also includes non-technical stuff, and today that includes religion.

I’m not religious. My mother has been raised a protestant, I’m not sure about my dad, but from an early age I’ve basically been raised with a general idea of not doing to someone else what you would not want to happen to yourself. The laws and morals in the Netherlands are highly based on christianity, and I agree with almost everything that’s still part of those. That’s about how far my grasp of religion goes: I’ve never attended church, and I’m just not sure if there’s anything out there. Maybe there is, maybe the christians are right, maybe there is a god. But hey, maybe the buddhists are right, or maybe the muslims. I could’ve picked any of those, but I’d rather just admit that I don’t know and will most likely never know.

Now, lately I’ve been reading a lot of articles on reddit.com, and someone the whole thing about atheism keeps popping up. I totally agree on opposing proposition 8, and I am completely against trying to spread faith. And that’s what most atheists are saying: Just let people make their own decisions, be it gay or heterosexual, christian or muslim, religious or not religious. It’s their own decision, and who the hell are you to judge that ?

What does however piss me off about this whole atheist hype nowadays is how they’re not acting as they’re preaching. For example, I’ve been watching “Religulous” today, and it just pissed me off. Yes, Bill Maher has a valid point. Yes, I totally agree with his point of view. But I don’t like how he’s almost attacking each and every religious person he’s interviewing. Take the jew-turned-to-jesus guy for example[1], he says that he’s seen some miracles and to him that is enough prove that there is in fact a god or a jesus. Surely we can accept that? Not Bill though, he asks what kind of miracles and, instead of simply having a few side-notes or a small monologue afterwards, actually tells the guy that his “bar for miracles is pretty low”. Come on? He believes in God, that’s his constitutional right, just as it’s your right not to, you have every right to disagree with him, but it’s just nasty to attack him like that.

If Religulous would have been a movie looking at christianity, proof of some of the flaws in the bible, and proof of other theories, it would’ve been all right with me.

However, going around publicly ridiculing everyone is something that I, for one, do not condone. Sorry Bill Maher, but this is one hell of a crappy documentary. I highly doubt that it’s done anything else than simply insult a whole lot of people.

[1] If you haven’t seen it, google it, it’s all over the web.

Work and Hobby

When I started StuffPlug, it was my hobby. Messing around with messenger was something I liked doing, and getting a useful program out of it was simply a pleasant side effect. However, lately my interest in messenger hasn’t been what it used to be, and as such no real update on StuffPlug has taken place. I sometimes feel I should try and force myself to work on it just for the sake of getting out a WLM9 compatible version and keeping it alive.

At the same time I’m currently working for Iminent on a temporary consulting job, and today I suddenly realised the whole “but I want StuffPlug to stay a hobby or else it won’t be StuffPlug”-feeling that I’ve carried around since my parents have been pushing me to commercialize it wasn’t just a feeling: Whenever you specifically work on a project, your goal is to get out the product. If you have to cut corners, you’ll do so. If you need some specific research, you’ll probably only research as much as you need. But this goes directly against how StuffPlug started: I’d do some research, mostly for fun, and stumble upon things I could use. Sometimes I’d dig in a little deeper with a specific purpose, but I’ve always just researched stuff for fun, instead of with a specific feature in mind.

I’m doubting now about StuffPlug. Should I just push myself to write something for WLM9 that resembles StuffPlug and try to replicate features, or should I just let it be until something new triggers my interest? I’m afraid that with the first option I’ll never be able to make StuffPlug in what it used to be, simply because I’d be doing it with a completely different mindset…