Commit 95df5966 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Set the from attribute on error packets.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5820 b35dd754-fafc-0310-a699-88a17e54d16e
parent b028bd6d
......@@ -44,6 +44,10 @@
Broadcast Plugin Changelog
</h1>
<p><b>1.5.2</b> -- October 24, 2006</p>
<ul>
<li>Error messages now include the "from" attribute so that they are valid packets.</li>
</ul>
<p><b>1.5.1</b> -- October 06, 2006</p>
<ul>
......
......@@ -8,8 +8,8 @@
<name>Broadcast</name>
<description>Broadcasts messages to users.</description>
<author>Jive Software</author>
<version>1.5.1</version>
<date>10/06/2006</date>
<version>1.5.2</version>
<date>10/24/2006</date>
<url>http://www.jivesoftware.org</url>
<minServerVersion>3.1.0</minServerVersion>
</plugin>
\ No newline at end of file
......@@ -146,6 +146,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
}
}
catch (GroupNotFoundException e) {
// Ignore.
}
}
if (packet instanceof Message) {
......@@ -180,6 +181,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
}
error.setError(PacketError.Condition.not_allowed);
error.setTo(message.getFrom());
error.setFrom(message.getTo());
error.setSubject("Error sending broadcast message");
error.setBody("Not allowed to send a broadcast message to " +
message.getTo());
......@@ -207,6 +209,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
error.setID(message.getID());
}
error.setTo(message.getFrom());
error.setFrom(message.getTo());
error.setError(PacketError.Condition.not_allowed);
error.setSubject("Error sending broadcast message");
error.setBody("Address not valid: " +
......@@ -239,6 +242,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
error.setID(message.getID());
}
error.setTo(message.getFrom());
error.setFrom(message.getTo());
error.setError(PacketError.Condition.not_allowed);
error.setSubject("Error sending broadcast message");
error.setBody("Not allowed to send a broadcast message to " +
......@@ -345,7 +349,7 @@ public class BroadcastPlugin implements Plugin, Component, PropertyEventListener
else if ("http://jabber.org/protocol/disco#items".equals(namespace)) {
if (iq.getTo().getNode() == null) {
// Return the list of groups hosted by the service that can be used by the user
Collection<Group> groups = null;
Collection<Group> groups;
JID address = new JID(iq.getFrom().toBareJID());
if (allowedUsers.contains(address)) {
groups = groupManager.getGroups();
......
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