diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-09-29 23:09:32 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-09-29 23:09:32 +0200 |
commit | c13ae1b932947dd102f8e3b20492a885f14a8198 (patch) | |
tree | 92ba491a3beac625926091800b0fe7621328b216 /poezio/core/commands.py | |
parent | 2428084c8d141b5defbfe738f163095ef8bd5be3 (diff) | |
download | poezio-c13ae1b932947dd102f8e3b20492a885f14a8198.tar.gz poezio-c13ae1b932947dd102f8e3b20492a885f14a8198.tar.bz2 poezio-c13ae1b932947dd102f8e3b20492a885f14a8198.tar.xz poezio-c13ae1b932947dd102f8e3b20492a885f14a8198.zip |
Print the error given by the server when /bookmark fails.
Diffstat (limited to 'poezio/core/commands.py')
-rw-r--r-- | poezio/core/commands.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py index eb7595ee..5c8199c0 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -449,14 +449,9 @@ class CommandCore: if password: bookmark.password = password - def callback(iq): - if iq["type"] != "error": - self.core.information('Bookmark added.', 'Info') - else: - self.core.information("Could not add the bookmarks.", "Info") - self.core.bookmarks.save_local() - self.core.bookmarks.save_remote(self.core.xmpp, callback) + self.core.bookmarks.save_remote(self.core.xmpp, + self.core.handler.on_bookmark_result) def _add_wildcard_bookmarks(self, method): new_bookmarks = [] @@ -471,16 +466,9 @@ class CommandCore: self.core.bookmarks.remove(bookmark) new_bookmarks.extend(self.core.bookmarks.bookmarks) self.core.bookmarks.set(new_bookmarks) - - def _cb(iq): - if iq["type"] != "error": - self.core.information("Bookmarks saved.", "Info") - else: - self.core.information("Could not save the remote bookmarks.", - "Info") - self.core.bookmarks.save_local() - self.core.bookmarks.save_remote(self.core.xmpp, _cb) + self.core.bookmarks.save_remote(self.core.xmpp, + self.core.handler.on_bookmark_result) @command_args_parser.ignored def bookmarks(self): |