aboutsummaryrefslogtreecommitdiff
path: root/libdino/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-05-28 00:27:06 +0200
committerfiaxh <git@lightrise.org>2020-06-03 21:50:40 +0200
commitd01af5b520d112b00e4c18b16657f89d5afe7ad4 (patch)
treec32a343766e72f95d2d67b456b41b66872e8cdfe /libdino/src
parent71be2abb6a007fd9b4ed3164d70f5cb95d49ce69 (diff)
downloaddino-d01af5b520d112b00e4c18b16657f89d5afe7ad4.tar.gz
dino-d01af5b520d112b00e4c18b16657f89d5afe7ad4.zip
Fix compiler warnings
Diffstat (limited to 'libdino/src')
-rw-r--r--libdino/src/service/counterpart_interaction_manager.vala12
-rw-r--r--libdino/src/service/database.vala4
-rw-r--r--libdino/src/service/entity_capabilities_storage.vala4
-rw-r--r--libdino/src/service/muc_manager.vala2
4 files changed, 10 insertions, 12 deletions
diff --git a/libdino/src/service/counterpart_interaction_manager.vala b/libdino/src/service/counterpart_interaction_manager.vala
index 1e5fd0e2..7a98f0ff 100644
--- a/libdino/src/service/counterpart_interaction_manager.vala
+++ b/libdino/src/service/counterpart_interaction_manager.vala
@@ -54,7 +54,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
public Gee.List<Jid>? get_typing_jids(Conversation conversation) {
if (stream_interactor.connection_manager.get_state(conversation.account) != ConnectionManager.ConnectionState.CONNECTED) return null;
- if (!typing_since.contains(conversation) || typing_since[conversation].size == 0) return null;
+ if (!typing_since.has_key(conversation) || typing_since[conversation].size == 0) return null;
var jids = new ArrayList<Jid>();
foreach (Jid jid in typing_since[conversation].keys) {
@@ -65,7 +65,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
private void on_account_added(Account account) {
stream_interactor.module_manager.get_module(account, Xep.ChatMarkers.Module.IDENTITY).marker_received.connect( (stream, jid, marker, id, message_stanza) => {
- on_chat_marker_received(account, jid, marker, id, message_stanza);
+ on_chat_marker_received.begin(account, jid, marker, id, message_stanza);
});
stream_interactor.module_manager.get_module(account, Xep.MessageDeliveryReceipts.Module.IDENTITY).receipt_received.connect((stream, jid, id) => {
on_receipt_received(account, jid, id);
@@ -76,7 +76,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
}
private void clear_chat_state(Conversation conversation, Jid jid) {
- if (!(typing_since.contains(conversation) && typing_since[conversation].contains(jid))) return;
+ if (!(typing_since.has_key(conversation) && typing_since[conversation].has_key(jid))) return;
typing_since[conversation].unset(jid);
received_state(conversation, Xmpp.Xep.ChatStateNotifications.STATE_ACTIVE);
@@ -85,9 +85,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
private void clear_all_chat_states(Account account) {
foreach (Conversation conversation in typing_since.keys) {
if (conversation.account.equals(account)) {
- foreach (Jid jid in typing_since[conversation].keys) {
- received_state(conversation, Xmpp.Xep.ChatStateNotifications.STATE_ACTIVE);
- }
+ received_state(conversation, Xmpp.Xep.ChatStateNotifications.STATE_ACTIVE);
typing_since[conversation].clear();
}
}
@@ -155,7 +153,7 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
ContentItem? content_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item(conversation, 1, message.id);
ContentItem? read_up_to_item = stream_interactor.get_module(ContentItemStore.IDENTITY).get_item_by_id(conversation, conversation.read_up_to_item);
- if (read_up_to_item != null && read_up_to_item.sort_time.compare(content_item.sort_time) > 0) return;
+ if (read_up_to_item != null && read_up_to_item.compare(content_item) > 0) return;
conversation.read_up_to_item = content_item.id;
} else {
// We can't currently handle chat markers in MUCs
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala
index a24822d2..841518d8 100644
--- a/libdino/src/service/database.vala
+++ b/libdino/src/service/database.vala
@@ -194,11 +194,11 @@ public class Database : Qlite.Database {
public Column<string> entity = new Column.Text("entity");
public Column<string> category = new Column.Text("category");
public Column<string> type = new Column.Text("type");
- public Column<string> name = new Column.Text("name");
+ public Column<string> entity_name = new Column.Text("name");
internal EntityIdentityTable(Database db) {
base(db, "entity_identity");
- init({entity, category, name, type});
+ init({entity, category, entity_name, type});
unique({entity, category, type}, "IGNORE");
index("entity_identity_idx", {entity});
}
diff --git a/libdino/src/service/entity_capabilities_storage.vala b/libdino/src/service/entity_capabilities_storage.vala
index 12b5d022..e716101a 100644
--- a/libdino/src/service/entity_capabilities_storage.vala
+++ b/libdino/src/service/entity_capabilities_storage.vala
@@ -33,7 +33,7 @@ public class EntityCapabilitiesStorage : Xep.EntityCapabilities.Storage, Object
.value(db.entity_identity.entity, entity)
.value(db.entity_identity.category, identity.category)
.value(db.entity_identity.type, identity.type_)
- .value(db.entity_identity.name, identity.name)
+ .value(db.entity_identity.entity_name, identity.name)
.perform();
return;
}
@@ -62,7 +62,7 @@ public class EntityCapabilitiesStorage : Xep.EntityCapabilities.Storage, Object
RowOption row = db.entity_identity.select().with(db.entity_identity.entity, "=", entity).single().row();
if (row.is_present()) {
- identity = new Identity(row[db.entity_identity.category], row[db.entity_identity.type], row[db.entity_identity.name]);
+ identity = new Identity(row[db.entity_identity.category], row[db.entity_identity.type], row[db.entity_identity.entity_name]);
}
identity_cache[entity] = identity;
return identity;
diff --git a/libdino/src/service/muc_manager.vala b/libdino/src/service/muc_manager.vala
index c4941b47..d96681ac 100644
--- a/libdino/src/service/muc_manager.vala
+++ b/libdino/src/service/muc_manager.vala
@@ -106,7 +106,7 @@ public class MucManager : StreamInteractionModule, Object {
// Check if this would be a valid nick
try {
- Jid jid = conversation.counterpart.with_resource(new_nick);
+ conversation.counterpart.with_resource(new_nick);
} catch (InvalidJidError error) { return; }
stream.get_module(Xep.Muc.Module.IDENTITY).change_nick(stream, conversation.counterpart, new_nick);