Projects tigase _server server-core Issues #287
feature-not-implemented while sending a first message to an online contactin roster (#287)
Won't Fix
kellogs . opened 1 decade ago

According to http://xmpp.org/rfcs/rfc3921.html#messaging - "4.1. Specifying an Intended Recipient" section it is not apparent that a message stanza MUST contain the destinator's full JID (including resource part) in its "to" attribute. RFC only talks about how it SHOULD do that. However, for the first message sent, where there is no chat context, the resource SHOULD be left out:

 the value of the 'to' address SHOULD be of the form <user@domain> rather than of the form <user@domain/resource>.

Method process(Packet, XMPPResourceConnection, NonAuthUserRepository, Queue) however has changed since 5.1.0 and does not respect that RFC any longer. See the part from:

      @           if (session.isUserId(to.getBareJID())) {

			// Yes this is message to 'this' client

			Packet result;

			// This is where and how we set the address of the component

			// which should rceive the result packet for the final delivery

			// to the end-user. In most cases this is a c2s or Bosh component

			// which keep the user connection.

			String resource = packet.getStanzaTo().getResource();

			if (resource == null) {

				// In default packet handler we deliver packets to a specific resource only

				result = Authorization.FEATURE_NOT_IMPLEMENTED.getResponseMessage(packet,

						"The feature is not supported yet.", true);

				result.setPacketFrom(null);

				result.setPacketTo(null);  @

which has changed from:

          @  if (session.isUserId(to.getBareJID())) {

			// Yes this is message to 'this' client

			if (log.isLoggable(Level.FINEST)) {

				log.log(Level.FINEST, "Yes, this is packet to ''this'' client: {0}", to);

			}

			// Element elem = packet.getElement().clone();

			// Packet result = new Packet(elem);

			// result.setTo(session.getConnectionId(packet.getElemTo()));

			// if (log.isLoggable(Level.FINEST)) {

			// log.finest("Setting to: " + result.getTo());

			// }

			// result.setFrom(packet.getTo());

			Packet result = packet.copyElementOnly();

			result.setPacketFrom(packet.getTo());

			try {

				result.setPacketTo(session.getConnectionId(packet.getStanzaTo()));

				results.offer(result);

			} catch (NoConnectionIdException ex) {

				log.log(Level.WARNING,

						"Packet to the server which hasn't been properly processed: {0}", packet);

			}

			return;

		} // end of else@

this change causes message stanzas not to be exchanged between two buddies.

Behaviour observed in https://projects.tigase.org/projects/tigase-server/repository/revisions/48635d0a30a0a28e062b8da33a3d6f8453418866

Andrzej Wójcik (Tigase) commented 1 decade ago

By default currently MessageAmp plugin is enabled and this plugin is responsible for forwarding message stanzas sent to bare jid. If I remember correctly, in case you disabled MessageAmp plugin you should enable Message plugin which will be responsible for forwarding message stanzas.

Please note that RFC3921 is now obsolete - for current RFC please see http://tools.ietf.org/html/rfc6121

issue 1 of 1
Type
Task
Priority
Blocker
Assignee
RedmineID
1745
Version
tigase-server-5.2.0
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#287
Please wait...
Page is in error, reload to recover