From 18321ed15ce782ff5d1f24de9f2fb459d714d125 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Tue, 31 Jan 2023 15:12:39 +0100 Subject: Collapse most stream releated errors into IOError --- libdino/src/service/message_processor.vala | 2 +- libdino/src/service/reactions.vala | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'libdino/src/service') diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala index 247206f3..ecac4004 100644 --- a/libdino/src/service/message_processor.vala +++ b/libdino/src/service/message_processor.vala @@ -459,7 +459,7 @@ public class MessageProcessor : StreamInteractionModule, Object { if (!conversation.type_.is_muc_semantic() && current_own_jid != null && !current_own_jid.equals(message.ourpart)) { message.ourpart = current_own_jid; } - } catch (IOStreamError e) { + } catch (IOError e) { message.marked = Entities.Message.Marked.UNSENT; if (stream != stream_interactor.get_stream(conversation.account)) { diff --git a/libdino/src/service/reactions.vala b/libdino/src/service/reactions.vala index 7cd7c146..3621dab1 100644 --- a/libdino/src/service/reactions.vala +++ b/libdino/src/service/reactions.vala @@ -37,7 +37,7 @@ public class Dino.Reactions : StreamInteractionModule, Object { try { send_reactions(conversation, content_item, reactions); reaction_added(conversation.account, content_item.id, conversation.account.bare_jid, reaction); - } catch (SendError e) {} + } catch (IOError e) {} } public void remove_reaction(Conversation conversation, ContentItem content_item, string reaction) { @@ -46,7 +46,7 @@ public class Dino.Reactions : StreamInteractionModule, Object { try { send_reactions(conversation, content_item, reactions); reaction_removed(conversation.account, content_item.id, conversation.account.bare_jid, reaction); - } catch (SendError e) {} + } catch (IOError e) {} } public Gee.List get_item_reactions(Conversation conversation, ContentItem content_item) { @@ -74,12 +74,12 @@ public class Dino.Reactions : StreamInteractionModule, Object { } } - private void send_reactions(Conversation conversation, ContentItem content_item, Gee.List reactions) throws SendError { + private void send_reactions(Conversation conversation, ContentItem content_item, Gee.List reactions) throws IOError { string? message_id = stream_interactor.get_module(ContentItemStore.IDENTITY).get_message_id_for_content_item(conversation, content_item); - if (message_id == null) throw new SendError.Misc("No message for content_item"); + if (message_id == null) throw new IOError.FAILED("No message for content_item"); XmppStream? stream = stream_interactor.get_stream(conversation.account); - if (stream == null) throw new SendError.NoStream(""); + if (stream == null) throw new IOError.NOT_CONNECTED("No stream"); var reactions_module = stream.get_module(Xmpp.Xep.Reactions.Module.IDENTITY); @@ -94,7 +94,7 @@ public class Dino.Reactions : StreamInteractionModule, Object { try { reactions_module.send_reaction.end(res); save_chat_reactions(conversation.account, conversation.account.bare_jid, content_item.id, now_millis, reactions); - } catch (SendError e) {} + } catch (IOError e) {} }); } } -- cgit v1.2.3-70-g09d2