Exemplo n.º 1
0
 private void DoAwayMessageReceived(string userName, string reason)
 {
     AwayMessageReceived?.Invoke(this, new UserAwayEventArgs(userName, reason));
 }
Exemplo n.º 2
0
        private static void accSess_OnUserRequestPropertyResult(AccSession session, IAccUser user, AccUserProp Property, int transId, AccResult hr, object propertyValue)
        {
            //if its the idle time, raise the event if necessary
            if (Property == AccUserProp.AccUserProp_IdleTime)
            {
                //if the user's idle time is > 0 then raise idle event
                if ((int)propertyValue > 0)
                {
                    BuddyWentIdle(user.Name, GetUsersGroupsNames(user));
                }
            }
            else if (Property == AccUserProp.AccUserProp_Profile)
            {
                //profile is actually an IM object
                IAccIm im = (IAccIm)propertyValue;

                //dequeue the request
                Actions.QueueOfRequests.Dequeue();

                //check that this is the last queued request
                if (Actions.QueueOfRequests.Count < 1)
                {
                    //add the profile to the return var
                    strReturnRequest += im.GetConvertedText(MIME_TYPE);

                    //invoke info received event
                    if (InfoReceived != null)
                    {
                        InfoReceived.Invoke(user.Name, strReturnRequest);
                    }
                }
                else
                {
                    //add the profile to the return
                    strReturnRequest = im.GetConvertedText(MIME_TYPE);
                }
            }
            else if (Property == AccUserProp.AccUserProp_AwayMessage)
            {
                //away message is actually an IM object
                IAccIm im = (IAccIm)propertyValue;

                //dequeue the request
                Actions.QueueOfRequests.Dequeue();

                //check the request count
                if (Actions.QueueOfRequests.Count < 1)
                {
                    //put this text at the beginning of the request
                    strReturnRequest = im.GetConvertedText(MIME_TYPE) + strReturnRequest;

                    //invoke away message reveived event
                    if (AwayMessageReceived != null)
                    {
                        AwayMessageReceived.Invoke(user.Name, strReturnRequest);
                    }
                }
                else
                {
                    //set the return request var as the decoded string
                    strReturnRequest = im.GetConvertedText(MIME_TYPE);
                }
            }
        }