diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-10-05 01:44:25 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-10-05 01:44:25 +0200 |
commit | 2444ac841fad00133f231e9667ab427c4ce4d39e (patch) | |
tree | f85d6a82d7aed6aa4d758fc3045858ec8f4452bc /src/gui/Ephraim.vala | |
parent | cabc0995c0e0964ecbef18470c6a483022879071 (diff) | |
download | ephraim-2444ac841fad00133f231e9667ab427c4ce4d39e.tar ephraim-2444ac841fad00133f231e9667ab427c4ce4d39e.zip |
Receiving messages works again (kinda)
Diffstat (limited to 'src/gui/Ephraim.vala')
-rw-r--r-- | src/gui/Ephraim.vala | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/gui/Ephraim.vala b/src/gui/Ephraim.vala index 5801966..fb5e77f 100644 --- a/src/gui/Ephraim.vala +++ b/src/gui/Ephraim.vala @@ -17,7 +17,7 @@ public class Ephraim { unowned Gtk.TreeView rosterView = builder.get_object("Roster") as Gtk.TreeView; - Gee.TreeMap<string, Conversation> conversations = new Gee.TreeMap<string, Conversation>(); + Gee.TreeMap<Eva.Ref, Conversation> conversations = new Gee.TreeMap<Eva.Ref, Conversation>(); unowned Gtk.Notebook conversationNotebook = builder.get_object("Conversations") as Gtk.Notebook; ContactList roster = new ContactList(rosterView); @@ -28,24 +28,22 @@ public class Ephraim { coreconn.update_contact.connect(roster.update_contact); - coreconn.new_conversation.connect((jid) => { + coreconn.new_conversation.connect((conv_ref, jid) => { Contact contact = roster.get_contact(jid); - if(contact != null) { - conversations[jid] = new Conversation(conversationNotebook, jid, contact.display_string); - } - else { - conversations[jid] = new Conversation(conversationNotebook, jid, null); - } + Conversation conv = new Conversation(conversationNotebook, jid, contact != null ? contact.display_string : null); - conversations[jid].send_message.connect((type, message) => coreconn.send_message(jid, type, message)); + conversations[conv_ref] = conv; + conv.send_message.connect((type, message) => coreconn.send_message(jid, type, message)); }); - coreconn.chat_message.connect((jid, type, from, message) => { - if(!(jid in conversations.keys)) + coreconn.chat_message.connect((conv_ref, from, type, message) => { + if(!(conv_ref in conversations.keys)) { + warn_if_reached(); return; + } - conversations[jid].chat_message(type, from, message); + conversations[conv_ref].chat_message(from, type, message); }); //if(!coreconn.start()) |