Exemplo n.º 1
0
        private void User_Ctcp_ActionReceived(IrcUser user, PrivateMessageReceivedEventArgs args)
        {
            string text    = user.Nickname + " " + args.Message;
            var    message = new IrcMessage(user.Network, MessageDirection.FromUser, user, IrcMessageType.Action, text);

            this.AddMessage(message);
        }
Exemplo n.º 2
0
 public static PrivateMessage FromEventArgs(PrivateMessageReceivedEventArgs eventArgs)
 {
     return(new PrivateMessage()
     {
         Id = eventArgs.Id,
         Timestamp = eventArgs.Timestamp,
         Username = eventArgs.Username,
         Message = eventArgs.Message,
         Acknowledged = false
     });
 }
Exemplo n.º 3
0
        internal int OnPrivateMessageReceived(int subType, int msgId, long fromQQ, string msg, int font)
        {
            PrivateMessageType type;

            switch (subType)
            {
            case 1:
                type = PrivateMessageType.Online;
                break;

            case 2:
                type = PrivateMessageType.Group;
                break;

            case 3:
                type = PrivateMessageType.DiscussGroup;
                break;

            case 11:
                type = PrivateMessageType.Friend;
                break;

            default:
                type = PrivateMessageType.Unknown;
                break;
            }


            var eventArgs = new PrivateMessageReceivedEventArgs(
                type, msgId, fromQQ, msg, font);

            try
            {
                PrivateMessageReceived?.Invoke(this, eventArgs);
            }
            catch (MessageInterceptedException)
            {
                Debug.Assert(eventArgs.ReturnValue == 1);
            }
            return(eventArgs.ReturnValue);
        }
Exemplo n.º 4
0
 void Client_PrivateMessageReceived(Object sender, PrivateMessageReceivedEventArgs e)
 {
     if (Disposed) return;
     if (e.Destination != Name) return;
     if (ChannelMessage != null) ChannelMessage(this, e);
 }
Exemplo n.º 5
0
 void _client_OnPrivateMessageReceived(object sender, PrivateMessageReceivedEventArgs e)
 {
     tbxLog.AppendText(string.Format("A private message out of channel '{0}' was send from '{1}' to channel {2}, the message was '{3}' bytes long\r\n", e.PrivateMessage.FromChannel, e.PrivateMessage.Sender, e.PrivateMessage.ToChannel, e.PrivateMessage.Message.Length));
 }
Exemplo n.º 6
0
        private void User_NoticeReceived(IrcUser user, PrivateMessageReceivedEventArgs args)
        {
            var message = new IrcMessage(user.Network, MessageDirection.FromUser, user, IrcMessageType.Notice, args.Message, user.Network.CurrentUser.Nickname);

            this.HandleGlobalMessage(message);
        }
Exemplo n.º 7
0
        private void User_MessageReceived(IrcUser user, PrivateMessageReceivedEventArgs args)
        {
            var message = new IrcMessage(user.Network, MessageDirection.FromUser, user, IrcMessageType.Normal, args.Message);

            this.AddMessage(message);
        }