Functions - notify message
From The Socknet
notify_message is used to inform a Provider or Service that a message exists somewhere on the Internet which the sender believes the receiver may be interested in.
Contents |
Specification
POST notify_message
{
from: { openid: "http://openid.com/user1/" },
guid: {
openid: "http://some-other-openid.com/",
id: "34"
},
edited: "Tue, 10 Aug 2010 02:44:40 GMT",
created: "Tue, 10 Aug 2010 02:44:40 GMT",
hash: {
md5: "ae74b0f944104962873c3e8e98cb5d42"
}
}
->
{ accepted: boolean
}
The notify_message function must be called via POST.
It requires a from field.
If the from field describes a user who is not friends with the recipient, the message should be rejected.
If the from field describes a Service, then the request should include a return field. If the user does not recognize the Service, the response will be a redirect.
The request should include the following fields from get_message:
- guid
- edited
- created
- recipients
- private
- deleted
If the sender of the message is not the owner of the message (according to the guid), then the request should include a hash field which holds an object. The hash object should have, at a minimum, an md5 field which holds a string with an MD5 hash of the message field as the sender has received it (via get_message).
The request may include a return.
If the message is a reply to another message, it should include a reply_to field containing the other message in this same format. (However, if the parent message is also a reply to another message, it is not required to include that message.)
The response is either an accept or a redirect. A Provider should not automatically accept a message from an unrecognized Service, and it should automatically reject a message from an unrecognized user.
Support
Providers must support this function.
Services must support this function if they register with the notification field set to true.
Further Reading
More Details
When a message is changed for any reason, it is sent again to the same friends who received it originally.
A call to the notify_message function does not necessarily indicate that the message is new or has been changed (as in Updating Messages). Example:
- User A finds a great lolcat and makes a comment about it (in the form of a reply).
- Several months later, User B makes friends with User A.
- Later still, User B discovers the same lolcat independently and shares it with his friends.
- User A's provider automatically sends User A's comment to User B because he is probably interested in it, even though it is several months old.

