def METHOD_NAME(self, enabled_accounts, status_message):
    if not self.interface:
        try:
            self.interface = Gio.DBusProxy.new_for_bus_sync(
                Gio.BusType.SESSION, Gio.DBusProxyFlags.NONE, None,
                'org.gajim.dbus', '/org/gajim/dbus/RemoteObject',
                'org.gajim.dbus.RemoteInterface', None)
        except GLib.Error:
            self.interface = None
    if self.interface:
        try:
            for account in self.interface.list_accounts():
                status = self.interface.get_status('(s)', account)
                if enabled_accounts != [] and \
                        account not in enabled_accounts:
                    continue
                if status in self.statuses:
                    self.interface.METHOD_NAME('(sss)',
                        status, status_message, account)
        except GLib.Error:
            self.interface = None