Commit 419cff55 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Replaced "sender" with "req_jid".


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1680 b35dd754-fafc-0310-a699-88a17e54d16e
parent 62f711bf
......@@ -68,7 +68,7 @@ public class PresenceStatusServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String sender = request.getParameter("sender");
String sender = request.getParameter("req_jid");
String jid = request.getParameter("jid");
String type = request.getParameter("type");
type = type == null ? "image" : type;
......
......@@ -38,18 +38,18 @@ class XMLPresenceProvider extends PresenceInfoProvider {
PrintWriter out = response.getWriter();
if (presence == null) {
// Recreate the unavailable presence with the last known status
String username = request.getParameter("username");
JID targetJID = new JID(request.getParameter("jid"));
presence = new Presence(Presence.Type.unavailable);
XMPPServer server = XMPPServer.getInstance();
try {
User user = server.getUserManager().getUser(username);
User user = server.getUserManager().getUser(targetJID.getNode());
String status = server.getPresenceManager().getLastPresenceStatus(user);
if (status != null) {
presence.setStatus(status);
}
}
catch (UserNotFoundException e) {}
presence.setFrom(server.createJID(username, null));
presence.setFrom(targetJID);
}
out.println(presence.toXML());
out.flush();
......@@ -62,20 +62,14 @@ class XMLPresenceProvider extends PresenceInfoProvider {
// Send a forbidden presence
Presence presence = new Presence();
presence.setError(PacketError.Condition.forbidden);
String username = request.getParameter("username");
if (username != null) {
try {
presence.setFrom(XMPPServer.getInstance().createJID(username, null));
}
catch (Exception e) {}
try {
presence.setFrom(new JID(request.getParameter("jid")));
}
String sender = request.getParameter("sender");
if (sender != null) {
try {
presence.setTo(new JID(sender));
}
catch (Exception e) {}
catch (Exception e) {}
try {
presence.setTo(new JID(request.getParameter("req_jid")));
}
catch (Exception e) {}
out.println(presence.toXML());
out.flush();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment