tbh, the stuff you added didn't fixed it and even wouldn't work (see first comment in my previous post
here). simply removing the 'status=status' line is a way better fix (which works) for this.
But to 'fix' it in a proper way you have to make a function which catches the icon handles and set the tray icon to the proper icon using that same API.