/// <summary> /// 退出,下线 /// </summary> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture DoLogout(QQActionListener listener) { CancelPoll(); var login = Context.GetModule <LoginModule>(QQModuleType.LOGIN); return(login.Logout(listener)); }
public MarkEmailAction(bool status, List <QQEmail> markList, IQQContext context, QQActionListener listener) : base(context, listener) { this.status = status; this.markList = markList; }
public UploadOfflinePictureAction(IQQContext context, QQActionListener listener, QQUser user, string file) : base(context, listener) { _user = user; _file = file; }
public MarkEmailAction(bool status, List<QQEmail> markList, IQQContext context, QQActionListener listener) : base(context, listener) { this.status = status; this.markList = markList; }
public GetOffPicAction(IQQContext context, QQActionListener listener, OffPicItem offpic, QQMsg msg, Stream picOut) : base(context, listener) { _offpic = offpic; _msg = msg; _picOut = picOut; }
public GetUserPicAction(IQQContext context, QQActionListener listener, CFaceItem cface, QQMsg msg, Stream picOut) : base(context, listener) { this.cface = cface; this.msg = msg; this.picOut = picOut; }
/** * <p>Constructor for GetGroupPicAction.</p> * * @param context a {@link iqq.im.core.IQQContext} object. * @param listener a {@link iqq.im.IQQActionListener} object. * @param cface a {@link iqq.im.bean.content.CFaceItem} object. * @param msg a {@link iqq.im.bean.QQMsg} object. * @param picOut a {@link java.io.OutputStream} object. */ public GetGroupPicAction(IQQContext context, QQActionListener listener, CFaceItem cface, QQMsg msg, Stream picOut) : base(context, listener) { _cface = cface; _msg = msg; _picOut = picOut; }
public IQQActionFuture Login(QQActionListener listener) { var future = new ProcActionFuture(listener, true); // DoGetLoginSig(future); // 这里可以直接替换成 DoCheckVerify(future); DoCheckVerify(future); return(future); }
public WebLoginAction(IQQContext context, QQActionListener listener, string username, string password, long uin, string verifyCode) : base(context, listener) { _username = username; _password = password; _uin = uin; _verifyCode = verifyCode; }
protected AbstractActionFuture(QQActionListener proxyListener) { _isCanceled = false; _hasEvent = true; EventQueue = new BlockingCollection <QQActionEvent>(); ProxyListener = proxyListener; Listener = (sender, args) => { ProxyListener?.Invoke(this, args); EventQueue.Add(args); }; Cts = new CancellationTokenSource(); }
/// <summary> /// 重新登录 /// </summary> /// <param name="status"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture Relogin(QQStatus status, QQActionListener listener) { if (Session.State == QQSessionState.Online) { //throw new Exception("client is aready online !!!"); return(null); } Account.Status = status; Session.State = QQSessionState.Logining; var procModule = GetModule <ProcModule>(QQModuleType.PROC); return(procModule.Relogin(status, listener)); }
protected AbstractActionFuture(QQActionListener proxyListener) { _isCanceled = false; _hasEvent = true; EventQueue = new BlockingCollection<QQActionEvent>(); ProxyListener = proxyListener; Listener = (sender, args) => { ProxyListener?.Invoke(this, args); EventQueue.Add(args); }; Cts = new CancellationTokenSource(); }
private void DoCheckQRCode(ProcActionFuture future) { if (future.IsCanceled) { return; } var login = Context.GetModule <LoginModule>(QQModuleType.LOGIN); QQActionListener handler = null; handler = (sender, Event) => { if (Event.Type == QQActionEventType.EvtOK) { var eventArgs = (CheckQRCodeArgs)Event.Target; switch (eventArgs.Status) { case QRCodeStatus.QRCODE_OK: Context.FireNotify(new QQNotifyEvent(QQNotifyEventType.QrcodeSuccess)); DoCheckLoginSig(eventArgs.Msg, future); break; case QRCodeStatus.QRCODE_VALID: Thread.Sleep(3000); login.CheckQRCode(handler); break; case QRCodeStatus.QRCODE_AUTH: Context.FireNotify(new QQNotifyEvent(QQNotifyEventType.QrcodeAuth, eventArgs.Msg)); login.CheckQRCode(handler); break; case QRCodeStatus.QRCODE_INVALID: Context.FireNotify(new QQNotifyEvent(QQNotifyEventType.QrcodeInvalid, eventArgs.Msg)); break; default: throw new ArgumentOutOfRangeException(); } } else if (Event.Type == QQActionEventType.EvtError) { future.NotifyActionEvent(QQActionEventType.EvtError, Event.Target); } }; login.CheckQRCode(handler); }
public IQQActionFuture Relogin(QQStatus status, QQActionListener listener) { Context.Account.Status = status; Context.Session.State = QQSessionState.Logining; var login = Context.GetModule <LoginModule>(QQModuleType.LOGIN); var future = login.ChannelLogin(status, (sender, Event) => { if (Event.Type == QQActionEventType.EvtError) { Context.Logger.LogInformation("iqq client ReloginChannel fail!!! use Login."); Login(listener); } else { listener(this, Event); } }); return(future); }
public IQQActionFuture LoginWithQRCode(QQActionListener listener) { var future = new ProcActionFuture(listener, true); var login = Context.GetModule <LoginModule>(QQModuleType.LOGIN); login.GetQRCode((sender, @event) => { if (@event.Type == QQActionEventType.EvtOK) { var verify = (Image)@event.Target; Context.FireNotify(new QQNotifyEvent(QQNotifyEventType.QrcodeReady, verify)); DoCheckQRCode(future); // future.NotifyActionEvent(QQActionEventType.EvtOK, @event.Target); } else if (@event.Type == QQActionEventType.EvtError) { future.NotifyActionEvent(QQActionEventType.EvtError, @event.Target); } }); return(future); }
/// <summary> /// 退出登录 /// </summary> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture Logout(QQActionListener listener) { if (Session.State == QQSessionState.Offline) { // Context.Logger.LogWarning($"{Account.Username}: client is aready offline !!!"); throw new Exception("client is aready offline !!!"); } var procModule = GetModule <ProcModule>(QQModuleType.PROC); return(procModule.DoLogout((sender, Event) => { // 无论退出登录失败还是成功,都需要释放资源 if (Event.Type == QQActionEventType.EvtOK || Event.Type == QQActionEventType.EvtError) { Session.State = QQSessionState.Offline; Destroy(); } listener?.Invoke(sender, Event); })); }
public IQQActionFuture SendMsg(QQMsg msg, QQActionListener listener) { var future = new ProcActionFuture(listener, true); if (msg.Type == QQMsgType.SESSION_MSG) { var stranger = (QQStranger)msg.To; if (string.IsNullOrEmpty(stranger.GroupSig)) { GetSessionMsgSig(stranger, (sender, Event) => { if (Event.Type == QQActionEventType.EvtOK) { DoSendMsg(msg, future.Listener); } else if (Event.Type == QQActionEventType.EvtError) { future.NotifyActionEvent(Event.Type, Event.Target); } }); } return future; } else if (msg.Type == QQMsgType.GROUP_MSG || msg.Type == QQMsgType.DISCUZ_MSG) { if (msg.Type == QQMsgType.GROUP_MSG) { if (msg.Group.Gin == 0) { msg.Group = Context.Store.GetGroupByCode(msg.Group.Code); return future; } } } return DoSendMsg(msg, listener); }
public IQQActionFuture SendMsg(QQMsg msg, QQActionListener listener) { var future = new ProcActionFuture(listener, true); if (msg.Type == QQMsgType.SESSION_MSG) { var stranger = (QQStranger)msg.To; if (string.IsNullOrEmpty(stranger.GroupSig)) { GetSessionMsgSig(stranger, (sender, Event) => { if (Event.Type == QQActionEventType.EvtOK) { DoSendMsg(msg, future.Listener); } else if (Event.Type == QQActionEventType.EvtError) { future.NotifyActionEvent(Event.Type, Event.Target); } }); } return(future); } else if (msg.Type == QQMsgType.GROUP_MSG || msg.Type == QQMsgType.DISCUZ_MSG) { if (msg.Type == QQMsgType.GROUP_MSG) { if (msg.Group.Gin == 0) { msg.Group = Context.Store.GetGroupByCode(msg.Group.Code); return(future); } } } return(DoSendMsg(msg, listener)); }
public GetStrangerInfoAction(IQQContext context, QQActionListener listener, QQUser user) : base(context, listener) { this.user = user; }
/// <summary> /// 获取登录二维码 /// </summary> /// <param name="qqActionListener"></param> public IQQActionFuture LoginWithQRCode(QQActionListener qqActionListener = null) { var login = GetModule <ProcModule>(QQModuleType.PROC); return(login.LoginWithQRCode(qqActionListener)); }
/// <summary> /// 搜索群列表 /// </summary> /// <param name="resultList"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture SearchGroupGetList(QQGroupSearchList resultList, QQActionListener listener) { var mod = GetModule <GroupModule>(QQModuleType.GROUP); return(mod.SearchGroup(resultList, listener)); }
/// <summary> /// 刷新验证码 /// </summary> /// <param name="verifyEvent"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture FreshVerify(QQNotifyEvent verifyEvent, QQActionListener listener) { var mod = GetModule <LoginModule>(QQModuleType.LOGIN); return(mod.GetCaptcha(Account.Uin, listener)); }
/// <summary> /// 临时消息信道,用于发送群U2U会话消息 /// </summary> /// <param name="user"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture GetSessionMsgSig(QQStranger user, QQActionListener listener) { var mod = GetModule <ChatModule>(QQModuleType.CHAT); return(mod.GetSessionMsgSig(user, listener)); }
public IQQActionFuture SearchGroup(QQGroupSearchList resultList, QQActionListener listener = null) { return PushHttpAction(new SearchGroupInfoAction(Context, listener, resultList)); }
/// <summary> /// 上传好友图片 /// </summary> /// <param name="file"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture UploadCustomPic(string file, QQActionListener listener) { var mod = GetModule <ChatModule>(QQModuleType.CHAT); return(mod.UploadCFace(file, listener)); }
/// <summary> /// 获取群聊天图片 /// </summary> /// <param name="cface"></param> /// <param name="msg"></param> /// <param name="picout"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture GetGroupPic(CFaceItem cface, QQMsg msg, Stream picout, QQActionListener listener) { var mod = GetModule <ChatModule>(QQModuleType.CHAT); return(mod.GetGroupPic(cface, msg, picout, listener)); }
public IQQActionFuture GetGroupList(QQActionListener listener = null) { return PushHttpAction(new GetGroupListAction(Context, listener)); }
public IQQActionFuture UpdateGroupMessageFilter(QQActionListener listener = null) { return PushHttpAction(new UpdateGroupMessageFilterAction(Context, listener)); }
public GetGroupListAction(IQQContext context, QQActionListener listener) : base(context, listener) { }
public IQQActionFuture GetGroupGid(QQGroup group, QQActionListener listener = null) { return PushHttpAction(new GetGroupAccoutAction(Context, listener, group)); }
public GetOnlineFriendAction(IQQContext context, QQActionListener listener) : base(context, listener) { }
/// <summary> /// 获取讨论组列表 /// </summary> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture GetDiscuzList(QQActionListener listener) { var mod = GetModule <DiscuzModule>(QQModuleType.DISCUZ); return(mod.GetDiscuzList(listener)); }
public IQQActionFuture GetMemberStatus(QQGroup group, QQActionListener listener = null) { return PushHttpAction(new GetGroupMemberStatusAction(Context, listener, group)); }
public IQQActionFuture GetStrangerInfo(QQUser user, QQActionListener listener = null) { return PushHttpAction(new GetStrangerInfoAction(Context, listener, user)); }
public IQQActionFuture ChangeStatus(QQStatus status, QQActionListener listener = null) { return PushHttpAction(new ChangeStatusAction(Context, listener, status)); }
/// <summary> /// 上传离线图片 /// </summary> /// <param name="user"></param> /// <param name="file"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture UploadOffPic(QQUser user, string file, QQActionListener listener) { var mod = GetModule <ChatModule>(QQModuleType.CHAT); return(mod.UploadOffPic(user, file, listener)); }
public GetGroupFaceAction(IQQContext context, QQActionListener listener, QQGroup group) : base(context, listener) { this._group = group; }
/// <summary> /// 发送正在输入通知 /// </summary> /// <param name="user"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture SendInputNotify(QQUser user, QQActionListener listener) { var mod = GetModule <ChatModule>(QQModuleType.CHAT); return(mod.SendInputNotify(user, listener)); }
public IQQActionFuture GetUserLevel(QQUser user, QQActionListener listener = null) { return PushHttpAction(new GetUserLevelAction(Context, listener, user)); }
/// <summary> /// 获取讨论组信息 /// </summary> /// <param name="discuz"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture GetDiscuzInfo(QQDiscuz discuz, QQActionListener listener) { var mod = GetModule <DiscuzModule>(QQModuleType.DISCUZ); return(mod.GetDiscuzInfo(discuz, listener)); }
public GetCaptchaImageAction(IQQContext context, QQActionListener listener, long uin) : base(context, listener) { _uin = uin; }
/// <summary> /// 获取群成员状态 /// </summary> /// <param name="group"></param> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture GetGroupMemberStatus(QQGroup group, QQActionListener listener) { var mod = GetModule <GroupModule>(QQModuleType.GROUP); return(mod.GetMemberStatus(group, listener)); }
public IQQActionFuture GetUserSign(QQUser user, QQActionListener listener = null) { return PushHttpAction(new GetFriendSignAction(Context, listener, user)); }
/// <summary> /// 更新群消息筛选 /// </summary> /// <param name="listener"></param> /// <returns></returns> public IQQActionFuture UpdateGroupMessageFilter(QQActionListener listener) { var mod = GetModule <GroupModule>(QQModuleType.GROUP); return(mod.UpdateGroupMessageFilter(listener)); }
public ChannelLoginAction(IQQContext context, QQActionListener listener, QQStatus status) : base(context, listener) { this._status = status; }
public void AcceptBuddyRequest(string qq, QQActionListener listener = null) { var mod = GetModule <BuddyModule>(QQModuleType.BUDDY); mod.AddBuddy(listener, qq); }
public IQQActionFuture GetDiscuzList(QQActionListener listener) { return PushHttpAction(new GetDiscuzListAction(this.Context, listener)); }
public GetFriendInfoAction(IQQContext context, QQActionListener listener, QQUser buddy) : base(context, listener) { _buddy = buddy; }
public IQQActionFuture GetDiscuzInfo(QQDiscuz discuz, QQActionListener listener) { return PushHttpAction(new GetDiscuzInfoAction(this.Context, listener, discuz)); }
public UploadCustomFaceAction(IQQContext context, QQActionListener listener, string file) : base(context, listener) { _file = file; }
public GetSelfInfoAction(IQQContext context, QQActionListener listener) : base(context, listener) { }
public GetGroupInfoAction(IQQContext context, QQActionListener listener, QQGroup group) : base(context, listener) { this._group = group; }
public CheckEmailSig(string url, IQQContext context, QQActionListener listener) : base(context, listener) { this._url = url; }
public GetWPKeyAction(string sid, IQQContext context, QQActionListener listener) : base(context, listener) { _sid = sid; }
public GetVFWebqq(IQQContext context, QQActionListener listener) : base(context, listener) { }