aboutsummaryrefslogtreecommitdiff
path: root/libdino/src
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-20 19:27:39 +0100
committerMarvin W <git@larma.de>2017-03-23 16:48:26 +0100
commitef0483765a0fd567f25b1f0af6df04e8973e5624 (patch)
tree9288c239217496774710542b922cdd264e0838cc /libdino/src
parentaca6842c490c52b6460b7d9ebd7cc77eec4b97ef (diff)
downloaddino-ef0483765a0fd567f25b1f0af6df04e8973e5624.tar.gz
dino-ef0483765a0fd567f25b1f0af6df04e8973e5624.zip
Small bug fixes and compatibility with Vala 0.36
Diffstat (limited to 'libdino/src')
-rw-r--r--libdino/src/entity/jid.vala4
-rw-r--r--libdino/src/service/database.vala17
-rw-r--r--libdino/src/service/roster_manager.vala8
3 files changed, 14 insertions, 15 deletions
diff --git a/libdino/src/entity/jid.vala b/libdino/src/entity/jid.vala
index f1da0c00..96948ca4 100644
--- a/libdino/src/entity/jid.vala
+++ b/libdino/src/entity/jid.vala
@@ -14,12 +14,12 @@ public class Dino.Entities.Jid : Object {
string? localpart = parsed != null ? parsed.localpart : null;
string domainpart = parsed != null ? parsed.domainpart : jid;
string? resourcepart = parsed != null ? parsed.resourcepart : null;
- Jid.components(localpart, domainpart, resourcepart);
+ this.components(localpart, domainpart, resourcepart);
}
public Jid.with_resource(string bare_jid, string resource) {
Jid? parsed = Jid.parse(bare_jid);
- Jid.components(parsed.localpart, parsed.domainpart, resourcepart);
+ this.components(parsed.localpart, parsed.domainpart, resourcepart);
}
public Jid.components(string? localpart, string domainpart, string? resourcepart) {
diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala
index f631ff1f..202a0930 100644
--- a/libdino/src/service/database.vala
+++ b/libdino/src/service/database.vala
@@ -1,5 +1,4 @@
using Gee;
-using Sqlite;
using Qlite;
using Dino.Entities;
@@ -17,7 +16,7 @@ public class Database : Qlite.Database {
public Column<string> alias = new Column.Text("alias");
public Column<bool> enabled = new Column.BoolInt("enabled");
- protected AccountTable(Database db) {
+ internal AccountTable(Database db) {
base(db, "account");
init({id, bare_jid, resourcepart, password, alias, enabled});
}
@@ -27,7 +26,7 @@ public class Database : Qlite.Database {
public Column<int> id = new Column.Integer("id") { primary_key = true, auto_increment = true };
public Column<string> bare_jid = new Column.Text("bare_jid") { unique = true, not_null = true };
- protected JidTable(Database db) {
+ internal JidTable(Database db) {
base(db, "jid");
init({id, bare_jid});
}
@@ -48,7 +47,7 @@ public class Database : Qlite.Database {
public Column<int> encryption = new Column.Integer("encryption");
public Column<int> marked = new Column.Integer("marked");
- protected MessageTable(Database db) {
+ internal MessageTable(Database db) {
base(db, "message");
init({id, stanza_id, account_id, counterpart_id, our_resource, counterpart_resource, direction,
type_, time, local_time, body, encryption, marked});
@@ -59,7 +58,7 @@ public class Database : Qlite.Database {
public Column<int> message_id = new Column.Integer("message_id") { primary_key = true };
public Column<string> real_jid = new Column.Text("real_jid");
- protected RealJidTable(Database db) {
+ internal RealJidTable(Database db) {
base(db, "real_jid");
init({message_id, real_jid});
}
@@ -70,7 +69,7 @@ public class Database : Qlite.Database {
public Column<int> type_ = new Column.Integer("type");
public Column<string> data = new Column.Text("data");
- protected UndecryptedTable(Database db) {
+ internal UndecryptedTable(Database db) {
base(db, "undecrypted");
init({message_id, type_, data});
}
@@ -86,7 +85,7 @@ public class Database : Qlite.Database {
public Column<int> encryption = new Column.Integer("encryption");
public Column<int> read_up_to = new Column.Integer("read_up_to");
- protected ConversationTable(Database db) {
+ internal ConversationTable(Database db) {
base(db, "conversation");
init({id, account_id, jid_id, active, last_active, type_, encryption, read_up_to});
}
@@ -97,7 +96,7 @@ public class Database : Qlite.Database {
public Column<string> hash = new Column.Text("hash");
public Column<int> type_ = new Column.Integer("type");
- protected AvatarTable(Database db) {
+ internal AvatarTable(Database db) {
base(db, "avatar");
init({jid, hash, type_});
}
@@ -107,7 +106,7 @@ public class Database : Qlite.Database {
public Column<string> entity = new Column.Text("entity");
public Column<string> feature = new Column.Text("feature");
- protected EntityFeatureTable(Database db) {
+ internal EntityFeatureTable(Database db) {
base(db, "entity_feature");
init({entity, feature});
}
diff --git a/libdino/src/service/roster_manager.vala b/libdino/src/service/roster_manager.vala
index 86bd7a21..bb9fbd3a 100644
--- a/libdino/src/service/roster_manager.vala
+++ b/libdino/src/service/roster_manager.vala
@@ -35,10 +35,10 @@ public class RosterManager : StreamInteractionModule, Object {
public Roster.Item? get_roster_item(Account account, Jid jid) {
Core.XmppStream? stream = stream_interactor.get_stream(account);
- if (stream != null) {
- return stream.get_flag(Roster.Flag.IDENTITY).get_item(jid.bare_jid.to_string());
- }
- return null;
+ if (stream == null) return null;
+ Xmpp.Roster.Flag? flag = stream.get_flag(Xmpp.Roster.Flag.IDENTITY);
+ if (flag == null) return null;
+ return flag.get_item(jid.bare_jid.to_string());
}
public void remove_jid(Account account, Jid jid) {