public AbstractHttpAction(QQContext context, QQActionListener.OnActionEvent handler) { this.context = context; evtHandlers += handler; this.retryTimes = 0; this.future = new AbstractActionFuture(handler); }
/** * <p>Constructor for GetGroupPicAction.</p> * * @param context a {@link iqq.im.core.QQContext} object. * @param listener a {@link iqq.im.QQActionListener} 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(QQContext context, QQActionListener.OnActionEvent listener, CFaceItem cface, QQMsg msg, byte[] picOut) : base(context, listener) { this.cface = cface; this.msg = msg; this.picOut = picOut; }
public AbstractActionFuture login(QQActionListener.OnActionEvent listener) { AbstractActionFuture future = new AbstractActionFuture(listener); doGetLoginSig(future); return(future); }
/** * <p>Constructor for WebLoginAction.</p> * * @param context a {@link iqq.im.core.QQContext} object. * @param listener a {@link iqq.im.QQActionListener.OnActionEvent} object. * @param username a {@link java.lang.String} object. * @param password a {@link java.lang.String} object. * @param uin a long. * @param verifyCode a {@link java.lang.String} object. */ public WebLoginAction(QQContext context, QQActionListener.OnActionEvent listener, String username, String password, long uin, String verifyCode) : base(context, listener) { this.username = username; this.password = password; this.uin = uin; this.verifyCode = verifyCode; }
/** * <p>doLogout.</p> * * @param listener a {@link iqq.im.QQActionListener.OnActionEvent} object. * @return a {@link iqq.im.evt.AbstractActionFuture} object. */ public AbstractActionFuture doLogout(QQActionListener.OnActionEvent listener) { AbstractActionFuture future = new AbstractActionFuture(listener); LoginModule loginModule = (LoginModule)getContext().getModule(AbstractModule.Type.LOGIN); loginModule.logout(listener); return(future); }
/** * {@inheritDoc} * * 重新登录 */ public void relogin(QQStatus status, QQActionListener.OnActionEvent listener) { if (session.getState() == QQWpfApplication1.action.QQSession.State.ONLINE) { throw new ApplicationException("client is aready online !!!"); } getAccount().setStatus(status); getSession().setState(QQSession.State.LOGINING); ProcModule procModule = (ProcModule)getModule(AbstractModule.Type.PROC); procModule.relogin(status, listener); }
/** * {@inheritDoc} * * 登录接口 */ public AbstractActionFuture login(QQStatus status, QQActionListener.OnActionEvent listener) { //检查客户端状态,是否允许登陆 if (session.getState() == QQWpfApplication1.action.QQSession.State.ONLINE) { throw new ApplicationException("client is aready online !!!"); } getAccount().setStatus(status); session.setState(QQSession.State.LOGINING); ProcModule procModule = (ProcModule)getModule(AbstractModule.Type.PROC); return(procModule.login(listener)); }
public AbstractActionFuture sendMsg(QQMsg msg, QQActionListener.OnActionEvent listener) { if (msg.getType() == QQMsg.Type.SESSION_MSG) { AbstractActionFuture future = new AbstractActionFuture(listener); QQStranger stranger = (QQStranger)msg.getTo(); if (stranger.getGroupSig() == null || stranger.getGroupSig().Equals("")) { getSessionMsgSig(stranger, delegate(QQActionEvent evt) { if (evt.getType() == QQActionEvent.Type.EVT_OK) { doSendMsg(msg, future); } else if (evt.getType() == QQActionEvent.Type.EVT_ERROR) { future.notifyActionEvent(evt.getType(), evt.getTarget()); } }); } return(future); } else if (msg.getType() == QQMsg.Type.GROUP_MSG || msg.getType() == QQMsg.Type.DISCUZ_MSG) { if (getContext().getSession().getCfaceKey() == null || getContext().getSession().getCfaceKey().Equals("")) { AbstractActionFuture future = new AbstractActionFuture(listener); getCFaceSig(delegate(QQActionEvent evt) { if (evt.getType() == QQActionEvent.Type.EVT_OK) { doSendMsg(msg, future); } else if (evt.getType() == QQActionEvent.Type.EVT_ERROR) { future.notifyActionEvent(evt.getType(), evt.getTarget()); } }); return(future); } } return(doSendMsg(msg, listener)); }
/** * <p>relogin.</p> * * @param status a {@link iqq.im.bean.QQStatus} object. * @param listener a {@link iqq.im.QQActionListener.OnActionEvent} object. * @return a {@link iqq.im.evt.AbstractActionFuture} object. */ public AbstractActionFuture relogin(QQStatus status, QQActionListener.OnActionEvent listener) { getContext().getAccount().setStatus(status); getContext().getSession().setState(QQSession.State.LOGINING); AbstractActionFuture future = new AbstractActionFuture(listener); LoginModule loginModule = (LoginModule)getContext().getModule(AbstractModule.Type.LOGIN); loginModule.channelLogin(status, delegate(QQActionEvent evt) { if (evt.getType() == QQActionEvent.Type.EVT_ERROR) { login(listener); } else { listener(evt); } }); return(future); }
/** * {@inheritDoc} * * 退出登录 */ public AbstractActionFuture logout(QQActionListener.OnActionEvent listener) { if (session.getState() == QQSession.State.OFFLINE) { throw new ApplicationException("client is aready offline !!!"); } ProcModule procModule = (ProcModule)getModule(AbstractModule.Type.PROC); return(procModule.doLogout(delegate(QQActionEvent evt) { // 无论退出登录失败还是成功,都需要释放资源 if (evt.getType() == QQActionEvent.Type.EVT_OK || evt.getType() == QQActionEvent.Type.EVT_ERROR) { session.setState(QQSession.State.OFFLINE); destroy(); } if (listener != null) { listener(evt); } })); }
/** * {@inheritDoc} * * 发送QQ消息 */ public AbstractActionFuture sendMsg(QQMsg msg, QQActionListener.OnActionEvent qqActionListener) { ChatModule mod = (ChatModule)getModule(AbstractModule.Type.CHAT); return(mod.sendMsg(msg, qqActionListener)); }
/** * {@inheritDoc} * * 获取陌生人信息 */ public AbstractActionFuture getStrangerInfo(QQUser user, QQActionListener.OnActionEvent qqActionListener) { UserModule mod = (UserModule)getModule(AbstractModule.Type.USER); return(mod.getStrangerInfo(user, qqActionListener)); }
/** * {@inheritDoc} * * 获取群号码 */ public AbstractActionFuture getGroupGid(QQGroup group, QQActionListener.OnActionEvent qqActionListener) { GroupModule mod = (GroupModule)getModule(AbstractModule.Type.GROUP); return(mod.getGroupGid(group, qqActionListener)); }
/** * {@inheritDoc} * * 改变状态 */ public AbstractActionFuture changeStatus(QQStatus status, QQActionListener.OnActionEvent listener) { UserModule userModule = (UserModule)getModule(AbstractModule.Type.USER); return(userModule.changeStatus(status, listener)); }
/** * {@inheritDoc} * * 使用UIN获取QQ号码 */ public AbstractActionFuture getUserQQ(QQUser user, QQActionListener.OnActionEvent qqActionListener) { UserModule userModule = (UserModule)getModule(AbstractModule.Type.USER); return(userModule.getUserAccount(user, qqActionListener)); }
/** * <p>Constructor for WebLogoutAction.</p> * * @param context a {@link iqq.im.core.QQContext} object. * @param listener a {@link iqq.im.QQActionListener.OnActionEvent} object. */ public WebLogoutAction(QQContext context, QQActionListener.OnActionEvent listener) : base(context, listener) { }
/** * <p>Constructor for GetFriendAccoutAction.</p> * * @param context a {@link iqq.im.core.QQContext} object. * @param listener a {@link iqq.im.QQActionListener} object. * @param buddy a {@link iqq.im.bean.QQUser} object. */ public GetFriendAccoutAction(QQContext context, QQActionListener.OnActionEvent listener, QQUser buddy) : base(context, listener) { this.buddy = buddy; }
/** {@inheritDoc} */ public AbstractActionFuture updateGroupMessageFilter(QQActionListener.OnActionEvent listener) { GroupModule mod = (GroupModule)getModule(AbstractModule.Type.GROUP); return(mod.updateGroupMessageFilter(listener)); }
//public AbstractActionFuture sendWbMsg(String msg, String acceptor, QQActionListener.OnActionEvent qqActionListener) { // WbProcModule procModule = (WbProcModule) getModule(AbstractModule.Type.WB_PROC); // return procModule.sendWbMsg(qqActionListener, msg, acceptor); //} //public AbstractActionFuture searchQmGroupMember(QmMemSearchCondition condition,QQActionListener.OnActionEvent qqActionListener) { // QmMgrModule mgrModule = (QmMgrModule) getModule(AbstractModule.Type.QM_MGR); // return mgrModule.searchGroupMember(condition, qqActionListener); //} //public AbstractActionFuture setQmGroupCard(String group, String uin, String card,QQActionListener.OnActionEvent qqActionListener) { // QmMgrModule mgrModule = (QmMgrModule) getModule(AbstractModule.Type.QM_MGR); // return mgrModule.setGroupCard(group, uin, card, qqActionListener); //} //public AbstractActionFuture deleteQmGroupMember(String group, ArrayList<String> memsDeleted, Boolean acceptApply,QQActionListener.OnActionEvent qqActionListener) { // QmMgrModule mgrModule = (QmMgrModule) getModule(AbstractModule.Type.QM_MGR); // return mgrModule.deleteGroupMember(group, memsDeleted, acceptApply, qqActionListener); //} /** * {@inheritDoc} * * 发送一个震动 */ //public AbstractActionFuture sendShake(QQUser user, QQActionListener.OnActionEvent qqActionListener) { // ChatModule mod = (ChatModule)getModule(AbstractModule.Type.CHAT); // return mod.sendShake(user, qqActionListener); //} /** * {@inheritDoc} * * 获取离线图片 */ //public AbstractActionFuture getOffPic(OffPicItem offpic, QQMsg msg, Stream picout, // QQActionListener.OnActionEvent listener) { // ChatModule mod = getModule(AbstractModule.Type.CHAT); // return mod.getOffPic(offpic, msg, picout, listener); //} /** * {@inheritDoc} * * 获取聊天图片 */ //public AbstractActionFuture getUserPic(CFaceItem cface, QQMsg msg, // Stream picout, QQActionListener.OnActionEvent listener){ // ChatModule mod = getModule(AbstractModule.Type.CHAT); // return mod.getUserPic(cface, msg, picout, listener); //} /** * {@inheritDoc} * * 获取群聊天图片 */ //public AbstractActionFuture getGroupPic(CFaceItem cface, QQMsg msg, // Stream picout, QQActionListener.OnActionEvent listener){ // ChatModule mod = getModule(AbstractModule.Type.CHAT); // return mod.getGroupPic(cface, msg, picout, listener); //} /** * {@inheritDoc} * * 上传离线图片 */ //public AbstractActionFuture uploadOffPic(QQUser user, FileInfo file, QQActionListener.OnActionEvent listener){ // ChatModule mod = getModule(AbstractModule.Type.CHAT); // return mod.uploadOffPic(user, file, listener); //} /** * {@inheritDoc} * * 上传好友图片 */ //public AbstractActionFuture uploadCustomPic(FileInfo file, QQActionListener.OnActionEvent listener){ // ChatModule mod = (ChatModule)getModule(AbstractModule.Type.CHAT); // return mod.uploadCFace(file, listener); //} /** * {@inheritDoc} * * 发送正在输入通知 */ //public AbstractActionFuture sendInAddNotify(QQUser user, QQActionListener.OnActionEvent listener){ // ChatModule mod = getModule(AbstractModule.Type.CHAT); // return mod.sendInAddNotify(user, listener); //} /** * {@inheritDoc} * * 获取讨论组列表 */ //public AbstractActionFuture getDiscuzList(QQActionListener.OnActionEvent qqActionListener) { // DiscuzModule mod = getModule(AbstractModule.Type.DISCUZ); // return mod.getDiscuzList(qqActionListener); //} /** * {@inheritDoc} * * 获取讨论组信息 */ //public AbstractActionFuture getDiscuzInfo(QQDiscuz discuz, QQActionListener.OnActionEvent qqActionListener) { // DiscuzModule mod = getModule(AbstractModule.Type.DISCUZ); // return mod.getDiscuzInfo(discuz, qqActionListener); //} /** * {@inheritDoc} * * 临时消息信道,用于发送群 U 2 U会话消息 */ //public AbstractActionFuture getSessionMsgSig(QQStranger user, QQActionListener.OnActionEvent qqActionListener) { // ChatModule mod = getModule(AbstractModule.Type.CHAT); // return mod.getSessionMsgSig(user, qqActionListener); //} /** * {@inheritDoc} * * 获取群成员状态 */ public AbstractActionFuture getGroupMemberStatus(QQGroup group, QQActionListener.OnActionEvent listener) { GroupModule mod = (GroupModule)getModule(AbstractModule.Type.GROUP); return(mod.getMemberStatus(group, listener)); }
/** * <p>Constructor for GetGroupInfoAction.</p> * * @param context a {@link iqq.im.core.QQContext} object. * @param listener a {@link iqq.im.QQActionListener} object. * @param group a {@link iqq.im.bean.QQGroup} object. */ public GetGroupInfoAction(QQContext context, QQActionListener.OnActionEvent listener, QQGroup group) : base(context, listener) { this.group = group; }
/** * <p>Constructor for UpdateGroupMessageFilterAction.</p> * * @param context a {@link iqq.im.core.QQContext} object. * @param listener a {@link iqq.im.QQActionListener} object. */ public UpdateGroupMessageFilterAction(QQContext context, QQActionListener.OnActionEvent listener) : base(context, listener) { }
public PollMsgAction(QQContext context, QQActionListener.OnActionEvent listener) : base(context, listener) { }
/** * {@inheritDoc} * * 刷新验证码 */ public AbstractActionFuture freshVerify(QQNotifyEvent verifyEvent, QQActionListener.OnActionEvent listener) { LoginModule mod = (LoginModule)getModule(AbstractModule.Type.LOGIN); return(mod.getCaptcha(account.getUin(), listener)); }
/** * <p>getCaptcha.</p> * * @param listener a {@link iqq.im.QQActionListener.OnActionEvent} object. */ public void getCaptcha(QQActionListener.OnActionEvent listener) { LoginModule loginModule = (LoginModule)getModule(AbstractModule.Type.LOGIN); loginModule.getCaptcha(getAccount().getUin(), listener); }
public GetOnlineFriendAction(QQContext context, QQActionListener.OnActionEvent listener) : base(context, listener) { }
/** * {@inheritDoc} * * 获取所有好友 */ public void getBuddyList(QQActionListener.OnActionEvent listener) { CategoryModule categoryModule = (CategoryModule)getModule(AbstractModule.Type.CATEGORY); categoryModule.getCategoryList(listener); }
public CheckLoginSigAction(QQContext context, QQActionListener.OnActionEvent listener, String checkSigUrl) : base(context, listener) { this.checkSigUrl = checkSigUrl; }
/** * {@inheritDoc} * * 获取群列表 */ public AbstractActionFuture getGroupList(QQActionListener.OnActionEvent listener) { GroupModule groupModule = (GroupModule)getModule(AbstractModule.Type.GROUP); return(groupModule.getGroupList(listener)); }
/** * <p>Constructor for ChangeStatusAction.</p> * * @param context a {@link iqq.im.core.QQContext} object. * @param listener a {@link iqq.im.QQActionListener} object. * @param status a {@link iqq.im.bean.QQStatus} object. */ public ChangeStatusAction(QQContext context, QQActionListener.OnActionEvent listener, QQStatus status) : base(context, listener) { this.status = status; }
/** * {@inheritDoc} * * 获取最近好友列表 */ public AbstractActionFuture getRecentList(QQActionListener.OnActionEvent qqActionListener) { BuddyModule buddyModule = (BuddyModule)getModule(AbstractModule.Type.BUDDY); return(buddyModule.getRecentList(qqActionListener)); }