diff --git a/mitterlib/network/__init__.py b/mitterlib/network/__init__.py index 817c696..2aac990 100644 --- a/mitterlib/network/__init__.py +++ b/mitterlib/network/__init__.py @@ -180,6 +180,10 @@ class Networks(object): message.network = shortcut result.append(message) self._operations += 1 + # don't check the operations count inside the loop; if Mitter + # fails, all the last messages can still be retrieved ('cause the + # config file wasn't saved yet.) + self._save() return result def update(self, status, reply_to=None, network=None): @@ -192,6 +196,7 @@ class Networks(object): for shortcut in self._targets(network): results.append(self.networks[shortcut].update(status, reply_to)) self._operations += 1 + self._save() return results def reply_prefix(self, message): @@ -205,6 +210,7 @@ class Networks(object): assert(isinstance(message, NetworkData)) self.networks[message.network].repost(message) self._operations += 1 + self._save() return def favourite(self, message): @@ -212,6 +218,7 @@ class Networks(object): assert(isinstance(message, NetworkData)) self.networks[message.network].favourite(message) self._operations += 1 + self._save() return def delete_message(self, message, network=None): @@ -223,6 +230,7 @@ class Networks(object): self.networks[network].delete_message(message) self._operations += 1 + self._save() return def message(self, message_id, network): @@ -235,6 +243,7 @@ class Networks(object): data = self.networks[network].message(message_id) data.network = network self._operations += 1 + self._save() return data def link(self, message): @@ -251,6 +260,7 @@ class Networks(object): message.network = shortcut result.append(message) self._operations += 1 + self._save() return result def available_requests(self, network=None):