Exemplo n.º 1
0
 /**  Returns list of conversations in the ContactGroup.
 @returns conversations
  */
 public SktConversation.List GetConversations()
 {
     if (skypeRef.logging) skypeRef.Log("Executing ContactGroup.GetConversations");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 3, OID);
     SktConversation.List conversations = new SktConversation.List(); // We always guarantee non-null list is returned
     skypeRef.transport.SubmitMethodRequest (RequestId);
     int argNr, marker;
     do
     {
     marker = (char)skypeRef.transport.ReadByte();
     if (marker != 'z')
     {
         if (marker == 'N') skypeRef.Error("SktContactGroup.GetConversations failed.");
         argNr = (char)skypeRef.transport.ReadByte();
         switch (argNr)
         {
             case 1:
                 conversations = (SktConversation.List)skypeRef.decoder.DecodeObjectList(18);
                 break;
             case 'z': marker = argNr; break; // exiting the arg loop if the method failed
             default:
                 skypeRef.Error(String.Format("Got unexpected response argument {0} from runtime in SktContactGroup.GetConversations", argNr));
                 break;
         }
     }
     } while (marker != 'z');
     skypeRef.transport.ResumeSocketReaderFromMethod();
     return conversations;
 }
Exemplo n.º 2
0
        public void OnAccountStatus(SktAccount sender, SktEvents.OnAccountStatusArgs e)
        {
            this.msgLog.AppendText(e.value.ToString() + "\r\n");

            if (e.value == SktAccount.STATUS.LOGGED_IN)
            {
                this.msgLog.AppendText("Retrieving conversation list..\r\n");
                conversationList = skype.GetConversationList(SktConversation.LIST_TYPE.INBOX_CONVERSATIONS);

                foreach (SktConversation conversation in conversationList)
                {
                    this.convListBox.Items.Add(conversation);
                }
                UpdateAudioDevices();
                UpdateVideoDevices();
            }

            if (e.value == SktAccount.STATUS.LOGGED_OUT)
            {
                this.msgLog.AppendText("Login failed because of " + sender.P_LOGOUTREASON + "\r\n");
            }
        }
Exemplo n.º 3
0
 internal override SktObjectList CreateObjectList(uint classId)
 {
     SktObjectList newList;
     switch (classId)
     {
     case  19 : newList = new SktParticipant.List(); break;
     case  10 : newList = new SktContactGroup.List(); break;
     case  11 : newList = new SktVideo.List(); break;
     case   9 : newList = new SktMessage.List(); break;
     case   7 : newList = new SktVoicemail.List(); break;
     case   6 : newList = new SktTransfer.List(); break;
     case   2 : newList = new SktContact.List(); break;
     case  18 : newList = new SktConversation.List(); break;
     case   1 : newList = new SktContactSearch.List(); break;
     case  12 : newList = new SktSms.List(); break;
     case   5 : newList = new SktAccount.List(); break;
     default: skypeRef.Error(String.Format("Attempt to construct a list object with invalid class ID {0}", classId)); return null;
     }
     return newList;
 }
Exemplo n.º 4
0
        // Logging account status, and when it goes LOGGED_IN, populate our listbox.
        public void OnAccountStatus(SktAccount sender, SktEvents.OnAccountStatusArgs e)
        {
            this.messageLog.AppendText(e.value.ToString() + "\r\n");

            if (e.value == SktAccount.STATUS.LOGGED_IN)
            {
                this.messageLog.AppendText("Retrieving conversation list..\r\n");

                conversationList = skype.GetConversationList(SktConversation.LIST_TYPE.INBOX_CONVERSATIONS);

                foreach (SktConversation conversation in conversationList)
                {
                    // Because we overrided SktConverstaion.ToString, we can add
                    // Conversation objects directly, to a standard ListBox.
                    this.conversationListBox.Items.Add(conversation);
                }
            }

            if (e.value == SktAccount.STATUS.LOGGED_OUT)
            {
                this.messageLog.AppendText("Login failed because of " + sender.P_LOGOUTREASON + "\r\n");
            }
        }