parent
1d1682a357
commit
f58119f25e
|
@ -48,6 +48,9 @@ public class CounterpartInteractionManager : StreamInteractionModule, Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void on_chat_state_received(Account account, Jid jid, string state, MessageStanza stanza) {
|
private async void on_chat_state_received(Account account, Jid jid, string state, MessageStanza stanza) {
|
||||||
|
// Don't show our own (other devices) typing notification
|
||||||
|
if (jid.equals_bare(account.bare_jid)) return;
|
||||||
|
|
||||||
Message message = yield stream_interactor.get_module(MessageProcessor.IDENTITY).parse_message_stanza(account, stanza);
|
Message message = yield stream_interactor.get_module(MessageProcessor.IDENTITY).parse_message_stanza(account, stanza);
|
||||||
Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_for_message(message);
|
Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_for_message(message);
|
||||||
if (conversation == null) return;
|
if (conversation == null) return;
|
||||||
|
|
|
@ -80,7 +80,6 @@ class ChatStatePopulator : Plugins.ConversationItemPopulator, Plugins.Conversati
|
||||||
meta_item = new MetaChatStateItem(stream_interactor, current_conversation, jid, state_type, jids);
|
meta_item = new MetaChatStateItem(stream_interactor, current_conversation, jid, state_type, jids);
|
||||||
item_collection.insert_item(meta_item);
|
item_collection.insert_item(meta_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins
|
||||||
firstLoad = false;
|
firstLoad = false;
|
||||||
}
|
}
|
||||||
stack.set_visible_child_name("void");
|
stack.set_visible_child_name("void");
|
||||||
|
clear();
|
||||||
initialize_for_conversation_(conversation);
|
initialize_for_conversation_(conversation);
|
||||||
display_latest();
|
display_latest();
|
||||||
stack.set_visible_child_name("main");
|
stack.set_visible_child_name("main");
|
||||||
|
@ -136,7 +137,6 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins
|
||||||
clear_notifications();
|
clear_notifications();
|
||||||
this.conversation = conversation;
|
this.conversation = conversation;
|
||||||
|
|
||||||
|
|
||||||
// Init for new conversation
|
// Init for new conversation
|
||||||
foreach (Plugins.ConversationItemPopulator populator in app.plugin_registry.conversation_addition_populators) {
|
foreach (Plugins.ConversationItemPopulator populator in app.plugin_registry.conversation_addition_populators) {
|
||||||
populator.init(conversation, this, Plugins.WidgetType.GTK);
|
populator.init(conversation, this, Plugins.WidgetType.GTK);
|
||||||
|
@ -149,8 +149,6 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins
|
||||||
}
|
}
|
||||||
|
|
||||||
private void display_latest() {
|
private void display_latest() {
|
||||||
clear();
|
|
||||||
|
|
||||||
Gee.List<ContentMetaItem> items = content_populator.populate_latest(conversation, 40);
|
Gee.List<ContentMetaItem> items = content_populator.populate_latest(conversation, 40);
|
||||||
foreach (ContentMetaItem item in items) {
|
foreach (ContentMetaItem item in items) {
|
||||||
do_insert_item(item);
|
do_insert_item(item);
|
||||||
|
|
|
@ -48,8 +48,7 @@ public class Module : XmppStreamModule {
|
||||||
if (!message.is_error()) {
|
if (!message.is_error()) {
|
||||||
Gee.List<StanzaNode> nodes = message.stanza.get_all_subnodes();
|
Gee.List<StanzaNode> nodes = message.stanza.get_all_subnodes();
|
||||||
foreach (StanzaNode node in nodes) {
|
foreach (StanzaNode node in nodes) {
|
||||||
if (node.ns_uri == NS_URI &&
|
if (node.ns_uri == NS_URI && node.name in STATES) {
|
||||||
node.name in STATES) {
|
|
||||||
chat_state_received(stream, message.from, node.name, message);
|
chat_state_received(stream, message.from, node.name, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue