mirror of
https://github.com/dino/dino.git
synced 2025-07-20 00:02:02 -04:00
Compare commits
3 Commits
0c45387bf9
...
86b101900c
Author | SHA1 | Date | |
---|---|---|---|
|
86b101900c | ||
|
8cb195a274 | ||
|
1e167eeea6 |
@ -39,12 +39,12 @@ public interface Application : GLib.Application {
|
|||||||
PresenceManager.start(stream_interactor);
|
PresenceManager.start(stream_interactor);
|
||||||
CounterpartInteractionManager.start(stream_interactor);
|
CounterpartInteractionManager.start(stream_interactor);
|
||||||
BlockingManager.start(stream_interactor);
|
BlockingManager.start(stream_interactor);
|
||||||
|
Calls.start(stream_interactor, db);
|
||||||
ConversationManager.start(stream_interactor, db);
|
ConversationManager.start(stream_interactor, db);
|
||||||
MucManager.start(stream_interactor);
|
MucManager.start(stream_interactor);
|
||||||
AvatarManager.start(stream_interactor, db);
|
AvatarManager.start(stream_interactor, db);
|
||||||
RosterManager.start(stream_interactor, db);
|
RosterManager.start(stream_interactor, db);
|
||||||
FileManager.start(stream_interactor, db);
|
FileManager.start(stream_interactor, db);
|
||||||
Calls.start(stream_interactor, db);
|
|
||||||
CallStore.start(stream_interactor, db);
|
CallStore.start(stream_interactor, db);
|
||||||
ContentItemStore.start(stream_interactor, db);
|
ContentItemStore.start(stream_interactor, db);
|
||||||
ChatInteraction.start(stream_interactor);
|
ChatInteraction.start(stream_interactor);
|
||||||
|
@ -52,7 +52,7 @@ public class AvatarManager : StreamInteractionModule, Object {
|
|||||||
if (hash == null) return null;
|
if (hash == null) return null;
|
||||||
File file = File.new_for_path(Path.build_filename(folder, hash));
|
File file = File.new_for_path(Path.build_filename(folder, hash));
|
||||||
if (!file.query_exists()) {
|
if (!file.query_exists()) {
|
||||||
fetch_and_store_for_jid(account, jid_);
|
fetch_and_store_for_jid.begin(account, jid_);
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return file;
|
return file;
|
||||||
@ -169,7 +169,7 @@ public class AvatarManager : StreamInteractionModule, Object {
|
|||||||
);
|
);
|
||||||
|
|
||||||
foreach (var entry in get_avatar_hashes(account, Source.USER_AVATARS).entries) {
|
foreach (var entry in get_avatar_hashes(account, Source.USER_AVATARS).entries) {
|
||||||
on_user_avatar_received(account, entry.key, entry.value);
|
on_user_avatar_received.begin(account, entry.key, entry.value);
|
||||||
}
|
}
|
||||||
foreach (var entry in get_avatar_hashes(account, Source.VCARD).entries) {
|
foreach (var entry in get_avatar_hashes(account, Source.VCARD).entries) {
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ public class AvatarManager : StreamInteractionModule, Object {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
on_vcard_avatar_received(account, entry.key, entry.value);
|
on_vcard_avatar_received.begin(account, entry.key, entry.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,8 +61,6 @@ namespace Dino {
|
|||||||
call_state.initiate_groupchat_call.begin(conversation.counterpart);
|
call_state.initiate_groupchat_call.begin(conversation.counterpart);
|
||||||
}
|
}
|
||||||
|
|
||||||
conversation.last_active = call.time;
|
|
||||||
|
|
||||||
call_outgoing(call, call_state, conversation);
|
call_outgoing(call, call_state, conversation);
|
||||||
|
|
||||||
return call_state;
|
return call_state;
|
||||||
@ -221,7 +219,6 @@ namespace Dino {
|
|||||||
|
|
||||||
Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(call.counterpart.bare_jid, account, Conversation.Type.CHAT);
|
Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(call.counterpart.bare_jid, account, Conversation.Type.CHAT);
|
||||||
stream_interactor.get_module(CallStore.IDENTITY).add_call(call, conversation);
|
stream_interactor.get_module(CallStore.IDENTITY).add_call(call, conversation);
|
||||||
conversation.last_active = call.time;
|
|
||||||
|
|
||||||
var call_state = new CallState(call, stream_interactor);
|
var call_state = new CallState(call, stream_interactor);
|
||||||
connect_call_state_signals(call_state);
|
connect_call_state_signals(call_state);
|
||||||
@ -294,7 +291,6 @@ namespace Dino {
|
|||||||
Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(inviter_jid.bare_jid, account);
|
Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(inviter_jid.bare_jid, account);
|
||||||
if (conversation == null) return null;
|
if (conversation == null) return null;
|
||||||
stream_interactor.get_module(CallStore.IDENTITY).add_call(call, conversation);
|
stream_interactor.get_module(CallStore.IDENTITY).add_call(call, conversation);
|
||||||
conversation.last_active = call.time;
|
|
||||||
|
|
||||||
CallState call_state = new CallState(call, stream_interactor);
|
CallState call_state = new CallState(call, stream_interactor);
|
||||||
connect_call_state_signals(call_state);
|
connect_call_state_signals(call_state);
|
||||||
@ -465,7 +461,6 @@ namespace Dino {
|
|||||||
|
|
||||||
Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).approx_conversation_for_stanza(from_jid, to_jid, account, message_stanza.type_);
|
Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).approx_conversation_for_stanza(from_jid, to_jid, account, message_stanza.type_);
|
||||||
if (conversation == null) return;
|
if (conversation == null) return;
|
||||||
conversation.last_active = call_state.call.time;
|
|
||||||
|
|
||||||
if (call_state.call.direction == Call.DIRECTION_INCOMING) {
|
if (call_state.call.direction == Call.DIRECTION_INCOMING) {
|
||||||
call_incoming(call_state.call, call_state, conversation, video_requested, multiparty);
|
call_incoming(call_state.call, call_state, conversation, video_requested, multiparty);
|
||||||
|
@ -29,6 +29,8 @@ public class ConversationManager : StreamInteractionModule, Object {
|
|||||||
stream_interactor.account_removed.connect(on_account_removed);
|
stream_interactor.account_removed.connect(on_account_removed);
|
||||||
stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(new MessageListener(stream_interactor));
|
stream_interactor.get_module(MessageProcessor.IDENTITY).received_pipeline.connect(new MessageListener(stream_interactor));
|
||||||
stream_interactor.get_module(MessageProcessor.IDENTITY).message_sent.connect(handle_sent_message);
|
stream_interactor.get_module(MessageProcessor.IDENTITY).message_sent.connect(handle_sent_message);
|
||||||
|
stream_interactor.get_module(Calls.IDENTITY).call_incoming.connect(handle_new_call);
|
||||||
|
stream_interactor.get_module(Calls.IDENTITY).call_outgoing.connect(handle_new_call);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Conversation create_conversation(Jid jid, Account account, Conversation.Type? type = null) {
|
public Conversation create_conversation(Jid jid, Account account, Conversation.Type? type = null) {
|
||||||
@ -194,6 +196,11 @@ public class ConversationManager : StreamInteractionModule, Object {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handle_new_call(Call call, CallState state, Conversation conversation) {
|
||||||
|
conversation.last_active = call.time;
|
||||||
|
start_conversation(conversation);
|
||||||
|
}
|
||||||
|
|
||||||
private void add_conversation(Conversation conversation) {
|
private void add_conversation(Conversation conversation) {
|
||||||
if (!conversations[conversation.account].has_key(conversation.counterpart)) {
|
if (!conversations[conversation.account].has_key(conversation.counterpart)) {
|
||||||
conversations[conversation.account][conversation.counterpart] = new ArrayList<Conversation>(Conversation.equals_func);
|
conversations[conversation.account][conversation.counterpart] = new ArrayList<Conversation>(Conversation.equals_func);
|
||||||
|
@ -388,9 +388,6 @@ public class Dino.HistorySync {
|
|||||||
page_result = PageResult.NoMoreMessages;
|
page_result = PageResult.NoMoreMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
string selection = null;
|
|
||||||
string[] selection_args = {};
|
|
||||||
|
|
||||||
string query_id = query_params.query_id;
|
string query_id = query_params.query_id;
|
||||||
string? after_id = query_params.start_id;
|
string? after_id = query_params.start_id;
|
||||||
|
|
||||||
|
@ -167,7 +167,6 @@ public class MessageProcessor : StreamInteractionModule, Object {
|
|||||||
new_message.counterpart = counterpart_override ?? (new_message.direction == Entities.Message.DIRECTION_SENT ? message.to : message.from);
|
new_message.counterpart = counterpart_override ?? (new_message.direction == Entities.Message.DIRECTION_SENT ? message.to : message.from);
|
||||||
new_message.ourpart = new_message.direction == Entities.Message.DIRECTION_SENT ? message.from : message.to;
|
new_message.ourpart = new_message.direction == Entities.Message.DIRECTION_SENT ? message.from : message.to;
|
||||||
|
|
||||||
XmppStream? stream = stream_interactor.get_stream(account);
|
|
||||||
Xmpp.MessageArchiveManagement.MessageFlag? mam_message_flag = Xmpp.MessageArchiveManagement.MessageFlag.get_flag(message);
|
Xmpp.MessageArchiveManagement.MessageFlag? mam_message_flag = Xmpp.MessageArchiveManagement.MessageFlag.get_flag(message);
|
||||||
EntityInfo entity_info = stream_interactor.get_module(EntityInfo.IDENTITY);
|
EntityInfo entity_info = stream_interactor.get_module(EntityInfo.IDENTITY);
|
||||||
if (mam_message_flag != null && mam_message_flag.mam_id != null) {
|
if (mam_message_flag != null && mam_message_flag.mam_id != null) {
|
||||||
|
@ -253,11 +253,12 @@ namespace Dino.Ui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool on_get_child_position(Widget widget, out Gdk.Rectangle allocation) {
|
private bool on_get_child_position(Widget widget, out Gdk.Rectangle allocation) {
|
||||||
|
allocation = Gdk.Rectangle();
|
||||||
|
|
||||||
if (widget == own_video_box) {
|
if (widget == own_video_box) {
|
||||||
int width = get_size(Orientation.HORIZONTAL);
|
int width = get_size(Orientation.HORIZONTAL);
|
||||||
int height = get_size(Orientation.VERTICAL);
|
int height = get_size(Orientation.VERTICAL);
|
||||||
|
|
||||||
allocation = Gdk.Rectangle();
|
|
||||||
allocation.width = own_video_width;
|
allocation.width = own_video_width;
|
||||||
allocation.height = own_video_height;
|
allocation.height = own_video_height;
|
||||||
allocation.x = width - own_video_width - 20;
|
allocation.x = width - own_video_width - 20;
|
||||||
|
@ -329,7 +329,7 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug
|
|||||||
do_insert_item(item);
|
do_insert_item(item);
|
||||||
}
|
}
|
||||||
ContentMetaItem meta_item = content_populator.get_content_meta_item(content_item);
|
ContentMetaItem meta_item = content_populator.get_content_meta_item(content_item);
|
||||||
Widget w = insert_new(meta_item);
|
insert_new(meta_item);
|
||||||
content_items.add(meta_item);
|
content_items.add(meta_item);
|
||||||
meta_items.add(meta_item);
|
meta_items.add(meta_item);
|
||||||
|
|
||||||
|
@ -45,7 +45,6 @@ public class FileImageWidget : Box {
|
|||||||
image.add_controller(gesture_click_controller);
|
image.add_controller(gesture_click_controller);
|
||||||
|
|
||||||
FileInfo file_info = file.query_info("*", FileQueryInfoFlags.NONE);
|
FileInfo file_info = file.query_info("*", FileQueryInfoFlags.NONE);
|
||||||
string? mime_type = file_info.get_content_type();
|
|
||||||
|
|
||||||
MenuButton button = new MenuButton();
|
MenuButton button = new MenuButton();
|
||||||
button.icon_name = "view-more";
|
button.icon_name = "view-more";
|
||||||
|
@ -26,15 +26,18 @@ namespace Dino.Ui.ConversationDetails {
|
|||||||
model.display_name.bind_property("display-name", view_model, "name", BindingFlags.SYNC_CREATE);
|
model.display_name.bind_property("display-name", view_model, "name", BindingFlags.SYNC_CREATE);
|
||||||
model.conversation.bind_property("notify-setting", view_model, "notification", BindingFlags.SYNC_CREATE, (_, from, ref to) => {
|
model.conversation.bind_property("notify-setting", view_model, "notification", BindingFlags.SYNC_CREATE, (_, from, ref to) => {
|
||||||
switch (model.conversation.get_notification_setting(stream_interactor)) {
|
switch (model.conversation.get_notification_setting(stream_interactor)) {
|
||||||
case Conversation.NotifySetting.ON:
|
case ON:
|
||||||
to = ViewModel.ConversationDetails.NotificationSetting.ON;
|
to = ViewModel.ConversationDetails.NotificationSetting.ON;
|
||||||
break;
|
break;
|
||||||
case Conversation.NotifySetting.OFF:
|
case OFF:
|
||||||
to = ViewModel.ConversationDetails.NotificationSetting.OFF;
|
to = ViewModel.ConversationDetails.NotificationSetting.OFF;
|
||||||
break;
|
break;
|
||||||
case Conversation.NotifySetting.HIGHLIGHT:
|
case HIGHLIGHT:
|
||||||
to = ViewModel.ConversationDetails.NotificationSetting.HIGHLIGHT;
|
to = ViewModel.ConversationDetails.NotificationSetting.HIGHLIGHT;
|
||||||
break;
|
break;
|
||||||
|
case DEFAULT:
|
||||||
|
// A "default" setting should have been resolved to the actual default value
|
||||||
|
assert_not_reached();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
@ -14,7 +14,6 @@ public class ConversationSelector : Widget {
|
|||||||
ListBox list_box = new ListBox() { hexpand=true };
|
ListBox list_box = new ListBox() { hexpand=true };
|
||||||
|
|
||||||
private StreamInteractor stream_interactor;
|
private StreamInteractor stream_interactor;
|
||||||
private uint? drag_timeout;
|
|
||||||
private HashMap<Conversation, ConversationSelectorRow> rows = new HashMap<Conversation, ConversationSelectorRow>(Conversation.hash_func, Conversation.equals_func);
|
private HashMap<Conversation, ConversationSelectorRow> rows = new HashMap<Conversation, ConversationSelectorRow>(Conversation.hash_func, Conversation.equals_func);
|
||||||
|
|
||||||
public ConversationSelector init(StreamInteractor stream_interactor) {
|
public ConversationSelector init(StreamInteractor stream_interactor) {
|
||||||
|
@ -109,6 +109,8 @@ namespace Dino.Ui {
|
|||||||
case ConnectionManager.ConnectionError.Source.TLS:
|
case ConnectionManager.ConnectionError.Source.TLS:
|
||||||
notification.set_body("Invalid TLS certificate");
|
notification.set_body("Invalid TLS certificate");
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
GLib.Application.get_default().send_notification(account.id.to_string() + "-connection-error", notification);
|
GLib.Application.get_default().send_notification(account.id.to_string() + "-connection-error", notification);
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,6 @@ public class List : Box {
|
|||||||
if (affiliation1 < affiliation2) return -1;
|
if (affiliation1 < affiliation2) return -1;
|
||||||
else if (affiliation1 > affiliation2) return 1;
|
else if (affiliation1 > affiliation2) return 1;
|
||||||
else return row_wrapper1.name_label.label.collate(row_wrapper2.name_label.label);
|
else return row_wrapper1.name_label.label.collate(row_wrapper2.name_label.label);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int get_affiliation_ranking(Xmpp.Xep.Muc.Affiliation affiliation) {
|
private int get_affiliation_ranking(Xmpp.Xep.Muc.Affiliation affiliation) {
|
||||||
|
@ -75,7 +75,6 @@ public static ViewModel.PreferencesRow.Any? get_data_form_field_view_model(DataF
|
|||||||
if (option.value == list_single_field.value) combobox_model.active_item = i;
|
if (option.value == list_single_field.value) combobox_model.active_item = i;
|
||||||
}
|
}
|
||||||
combobox_model.bind_property("active-item", list_single_field, "value", BindingFlags.DEFAULT, (binding, from, ref to) => {
|
combobox_model.bind_property("active-item", list_single_field, "value", BindingFlags.DEFAULT, (binding, from, ref to) => {
|
||||||
var src_field = (DataForms.DataForm.ListSingleField) binding.dup_target();
|
|
||||||
var active_item = (int) from;
|
var active_item = (int) from;
|
||||||
to = list_single_field.options[active_item].value;
|
to = list_single_field.options[active_item].value;
|
||||||
return true;
|
return true;
|
||||||
|
@ -97,10 +97,6 @@ public class EntryLabelHybrid : LabelHybrid {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void on_focus_leave() {
|
|
||||||
show_label();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void update_label() {
|
private void update_label() {
|
||||||
if (visibility) {
|
if (visibility) {
|
||||||
label.label = entry.text;
|
label.label = entry.text;
|
||||||
|
@ -116,8 +116,10 @@ public class AccountSettingsEntry : Plugins.AccountSettingsEntry {
|
|||||||
SourceFunc callback = fetch_keys.callback;
|
SourceFunc callback = fetch_keys.callback;
|
||||||
new Thread<void*> (null, () => { // Querying GnuPG might take some time
|
new Thread<void*> (null, () => { // Querying GnuPG might take some time
|
||||||
try {
|
try {
|
||||||
keys = GPGHelper.get_keylist(null, true);
|
keys = GPGHelper.get_keylist(null, true);
|
||||||
} catch (Error e) { }
|
} catch (Error e) {
|
||||||
|
warning(e.message);
|
||||||
|
}
|
||||||
Idle.add((owned)callback);
|
Idle.add((owned)callback);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
@ -117,6 +117,7 @@ public static Gee.List<Key> get_keylist(string? pattern = null, bool secret_only
|
|||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
if (e.code != GPGError.ErrorCode.EOF) throw e;
|
if (e.code != GPGError.ErrorCode.EOF) throw e;
|
||||||
}
|
}
|
||||||
|
context.op_keylist_end();
|
||||||
return keys;
|
return keys;
|
||||||
} finally {
|
} finally {
|
||||||
global_mutex.unlock();
|
global_mutex.unlock();
|
||||||
|
@ -38,7 +38,7 @@ namespace GPG {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Compact]
|
[Compact]
|
||||||
[CCode (cname = "struct _gpgme_key", ref_function = "gpgme_key_ref", ref_function_void = true, unref_function = "gpgme_key_unref", free_function = "gpgme_key_release")]
|
[CCode (cname = "struct _gpgme_key", ref_function = "gpgme_key_ref_vapi", unref_function = "gpgme_key_unref_vapi", free_function = "gpgme_key_release")]
|
||||||
public class Key {
|
public class Key {
|
||||||
public bool revoked;
|
public bool revoked;
|
||||||
public bool expired;
|
public bool expired;
|
||||||
|
@ -16,7 +16,7 @@ public class Dino.Plugins.Rtp.Paintable : Gdk.Paintable, Object {
|
|||||||
|
|
||||||
public override Gdk.Paintable get_current_image() {
|
public override Gdk.Paintable get_current_image() {
|
||||||
if (image != null) return image;
|
if (image != null) return image;
|
||||||
return Gdk.Paintable.new_empty(0, 0);
|
return Gdk.Paintable.empty(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int get_intrinsic_width() {
|
public override int get_intrinsic_width() {
|
||||||
|
@ -30,9 +30,9 @@ public abstract class Xmpp.XmppStream : Object {
|
|||||||
this.remote_name = remote_name;
|
this.remote_name = remote_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract async void connect() throws IOError;
|
public abstract new async void connect() throws IOError;
|
||||||
|
|
||||||
public abstract async void disconnect() throws IOError;
|
public abstract new async void disconnect() throws IOError;
|
||||||
|
|
||||||
public abstract async StanzaNode read() throws IOError;
|
public abstract async StanzaNode read() throws IOError;
|
||||||
|
|
||||||
|
@ -1,23 +1,11 @@
|
|||||||
namespace Xmpp.Xep.DateTimeProfiles {
|
namespace Xmpp.Xep.DateTimeProfiles {
|
||||||
|
|
||||||
public DateTime? parse_string(string time_string) {
|
public DateTime? parse_string(string time_string) {
|
||||||
// TODO with glib >= 2.56
|
return new DateTime.from_iso8601(time_string, null);
|
||||||
// return new DateTime.from_iso8601(time_string, null);
|
|
||||||
|
|
||||||
TimeVal time_val = TimeVal();
|
|
||||||
if (time_val.from_iso8601(time_string)) {
|
|
||||||
return new DateTime.from_unix_utc(time_val.tv_sec);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string to_datetime(DateTime time) {
|
public string to_datetime(DateTime time) {
|
||||||
// TODO with glib >= 2.62
|
return time.to_utc().format_iso8601().to_string();
|
||||||
// return time.to_utc().format_iso8601().to_string();
|
|
||||||
|
|
||||||
return time.to_utc().format("%Y-%m-%dT%H:%M:%SZ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user