How To - Forward Messages

From The Socknet

(Redirected from Message Forwarding)
Jump to: navigation, search

Messages may be forwarded to friends arbitrarily, either automatically or as specifically requested by the user. One good example is when a photo service allows a user to identify friends in a photo.

  1. The service notifies the user's provider of a message.
  2. The user's provider finds the OpenID's of friends in the message and forwards the message to them.

Message forwarding requires the use of the hash field.

Hashing

Because the originating party has complete control over the message, it would be possible to send out one message, allow it to be forwarded and then replace it with a different message. Hashing is used to avoid that insecurity.

POST notify_message
{ hash: {
  	md5: "ae74b0f944104962873c3e8e98cb5d42"
  }
  ...
}

The hash is a hash of the message field as returned by the originating party. When a provider forwards, it generates this hash based on the message it sees. If a requestor collects a message that doesn't match the hash given, it may be considered an inaccurate message and should be ignored.

The hash object may have any type of hash. The only one defined currently is MD5, which is always required. The hash object has an md5 field that holds an MD5 hash of the message field in hexadecimal in a string.

When collecting a message, a provider SHOULD verify that the hash is correct. If the hash is not correct, this may be a deliberate attempt to trick the system or it may just be the result of an update that hasn't arrived yet. The provider should ignore the message and wait for the update.

Considerations

When a provider receives a message from a service, it should generally be automatically forwarded to all the friends mentioned in the message. However, if the message has been propagated through a friend, it should not be automatically forwarded any further. The objective is to help the message's creator get the message out, but avoid attempts to "route" messages through friends to non-friends. If UserA is friends with UserB, who is friends with UserC, who is friends with UserD, it is conceivable that someone could create a message with UserA, UserB, UserC, and UserD, and it would arrive at UserD, unless this requirement is met.

During registration, services can request to be notified whenever the user posts. See Service Registration. The user should decide whether to send all messages or just the messages that would be sent to friends.

See Also

Personal tools