virtual void post(ResponsePtr response,
					  const LLSD& context,
					  const LLSD& input) const
	{
		LLSD body;
		LLUUID temp_session_id;
		LLUUID session_id;
		bool success;

		body = input["body"];
		success = body["success"].asBoolean();
		temp_session_id = body["temp_session_id"].asUUID();

		if ( success )
		{
			session_id = body["session_id"].asUUID();
			gIMMgr->updateFloaterSessionID(
				temp_session_id,
				session_id);
			LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id);
			if (floaterp)
			{
				floaterp->setSpeakers(body);

				//apply updates we've possibly received previously
				floaterp->updateSpeakersList(
					gIMMgr->getPendingAgentListUpdates(session_id));

				if ( body.has("session_info") )
				{
					floaterp->processSessionUpdate(body["session_info"]);
				}

				//aply updates we've possibly received previously
				floaterp->updateSpeakersList(
					gIMMgr->getPendingAgentListUpdates(session_id));
			}
			gIMMgr->clearPendingAgentListUpdates(session_id);
		}
		else
		{
			//throw an error dialog and close the temp session's
			//floater
			LLFloaterIMPanel* floater = 
				gIMMgr->findFloaterBySession(temp_session_id);

			if ( floater )
			{
				floater->showSessionStartError(body["error"].asString());
			}
		}

		gIMMgr->clearPendingAgentListUpdates(session_id);
	}
Exemple #2
0
	void error(U32 statusNum, const std::string& reason)
	{		
		//throw something back to the viewer here?
		if ( gIMMgr )
		{
			gIMMgr->clearPendingAgentListUpdates(mSessionID);
			gIMMgr->clearPendingInvitation(mSessionID);

			LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(mSessionID);

			if ( floaterp )
			{
				if ( 404 == statusNum )
				{
					std::string error_string;
					error_string = "session_does_not_exist_error";

					floaterp->showSessionStartError(error_string);
				}
			}
		}
	}
	/*virtual*/ void httpFailure(void)
	{
		LL_WARNS() << "LLViewerChatterBoxInvitationAcceptResponder error [status:"
				<< mStatus << "]: " << mReason << LL_ENDL;
		//throw something back to the viewer here?
		if ( gIMMgr )
		{
			gIMMgr->clearPendingAgentListUpdates(mSessionID);
			gIMMgr->clearPendingInvitation(mSessionID);

			LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(mSessionID);

			if ( floaterp )
			{
				if ( 404 == mStatus )
				{
					std::string error_string;
					error_string = "session_does_not_exist_error";

					floaterp->showSessionStartError(error_string);
				}
			}
		}
	}