internal Conversation(Messenger msn, Contact otherUser, object clientData) { this.users = new Hashtable(); this.transaction = 0; this.sessionID = 0; this.ClientData = null; this.socketBuffer = new byte[0x1000]; this.messenger = msn; this.contactToCall = otherUser; this.ClientData = clientData; }
// Methods internal ContactGroup(string name, int id, Messenger messenger) { this.name = name; this.id = id; this.messenger = messenger; }
private void OnSynchronizationCompleted(Messenger sender, EventArgs e) { // first show all people who are on our forwardlist. This is the 'main' contactlist // a normal person would see when logging in. // if you want to get all 'online' people enumerate trough this list and extract // all contacts with the right DotMSN.MSNStatus (eg online/away/busy) foreach(Contact contact in messenger.GetListEnumerator(MSNList.ForwardList)) { Console.Text = "FL > " + contact.Name + " (" + contact.Status + ")\r\n"; } // now get the reverse list. This list shows all people who have you on their // contactlist. foreach(Contact contact in messenger.ReverseList) { Console.Text= "RL > " + contact.Name + " (" + contact.Status + ")\r\n"; } // we follow with the blocked list. this shows all the people who are blocked // by you foreach(Contact contact in messenger.BlockedList) { Console.Text= "BL > " + contact.Name + " (" + contact.Status + ")\r\n"; } // when the privacy of the client is set to MSNPrivacy.NoneButAllowed then only // the contacts on the allowedlist are able to see your status foreach(Contact contact in messenger.AllowedList) { Console.Text = "AL > " + contact.Name + " (" + contact.Status + ")\r\n"; } // now set our initial status ! // we must set an initial status otherwise messenger.SetStatus(MSNStatus.Online); Console.Text = "Status set to online!\r\n"; /* the alllist just enumerates all possible contacts. it is not very usefull in * this sample so i've commented it out. foreach(Contact contact in messenger.AllList) { this.Log.Text += "AL > " + contact.Name + " (" + contact.Status + ")"; } */ /* uncomment this when you want to automatically add * people who have added you to their contactlist on your own * contactlist. (remember the pop-up dialog in MSN Messenger client when someone adds you, this is the 'automatic' method)*/ foreach(Contact contact in messenger.GetListEnumerator(MSNList.ReverseList)) { Thread.Sleep(5000); messenger.AddContact(contact.Mail); Thread.Sleep(5000); messenger.RequestConversation(contact.Mail); } }
private void OnReceivingMessages(Messenger sender, string a) { Console.Text ="Hotmail MSG: " + a; return; }
private void OnContactOnline(Messenger sender, ContactEventArgs e) { Console.Text = e.Contact.Name + " went online\r\n"; //messenger.SynchronizeList(); //messenger.SetStatus(MSNStatus.Online); messenger.RequestConversation(e.Contact.Mail); }
private void OnContactOffline(Messenger sender, ContactEventArgs e) { Console.Text = e.Contact.Name + " went offline\r\n"; }
private void OnContactAdded(Messenger sender, ListMutateEventArgs e) { Console.Text = "received contact"; return; }
private void ConversationCreated(Messenger sender, ConversationEventArgs e) { // we request a conversation or were asked one. Now log this Console.Text = "Conversation object created\r\n"; // remember there are not yet users in the conversation (except ourselves) // they will join _after_ this event. We create another callback to handle this. // When user(s) have joined we can start sending messages. e.Conversation.ContactJoin += new Conversation.ContactJoinHandler(ContactJoined); // log the event when the two clients are connected e.Conversation.ConnectionEstablished += new Conversation.ConnectionEstablishedHandler(ConnectionEstablished); // notify us when the other contact is typing something e.Conversation.UserTyping += new Conversation.UserTypingHandler(ContactTyping); //exchange messages e.Conversation.MessageReceived += new Conversation.MessageReceivedHandler(OnConversationReceived); }
internal Conversation(Socket switchBoard, string sbHash, Contact otherUser, Messenger msn, int session) { this.users = new Hashtable(); this.transaction = 0; this.sessionID = 0; this.ClientData = null; this.socketBuffer = new byte[0x1000]; this.contactToCall = otherUser; this.hash = sbHash; this.socketSB = switchBoard; this.messenger = msn; this.sessionID = session; }
private void OnReceivingMessages(Messenger sender, string a) { Console.WriteLine("Hotmail MSG: " + a); return; }
private void OnContactOffline(Messenger sender, ContactEventArgs e) { Console.WriteLine(e.Contact.Name + " went offline\r\n"); }
private void OnContactAdded(Messenger sender, ListMutateEventArgs e) { Console.WriteLine("received contact"); return; }