aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2023-01-31 15:12:39 +0100
committerMarvin W <git@larma.de>2023-02-07 10:50:43 +0100
commit18321ed15ce782ff5d1f24de9f2fb459d714d125 (patch)
treebaf849afe826691b351110b8899701f698692eb9 /libdino
parent95fefaff51e5506d3f0e5fe8bced14aeb3fbe037 (diff)
downloaddino-18321ed15ce782ff5d1f24de9f2fb459d714d125.tar.gz
dino-18321ed15ce782ff5d1f24de9f2fb459d714d125.zip
Collapse most stream releated errors into IOError
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/service/message_processor.vala2
-rw-r--r--libdino/src/service/reactions.vala12
2 files changed, 7 insertions, 7 deletions
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<ReactionUsers> 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<string> reactions) throws SendError {
+ private void send_reactions(Conversation conversation, ContentItem content_item, Gee.List<string> 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) {}
});
}
}