aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/reactions.vala
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/src/service/reactions.vala
parent95fefaff51e5506d3f0e5fe8bced14aeb3fbe037 (diff)
downloaddino-18321ed15ce782ff5d1f24de9f2fb459d714d125.tar.gz
dino-18321ed15ce782ff5d1f24de9f2fb459d714d125.zip
Collapse most stream releated errors into IOError
Diffstat (limited to 'libdino/src/service/reactions.vala')
-rw-r--r--libdino/src/service/reactions.vala12
1 files changed, 6 insertions, 6 deletions
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) {}
});
}
}