> Hi all,
>
> I've just signed up to the list, but have been using status.net via
> identi.ca for a year or so.  I wrote my first plugin last month -
> http://davehall.com.au/blog/dave/2010/02/20/group-redent-plugin-statusnet-identica
>  Now I feel like I am ready to contribute something back to the core, even
> though there is a fair bit of self interest in the contribution.
>
> I would like to see status.net (and identi.ca) support X mail headers
> for messages sent from the service.  I would propose the following
> headers
>
> X-StatusNet-Domain: <site-fqdn>
> X-StatusNet-TargetUser: <nickname>
> X-StatusNet-SourceUser: <nickname>
> X-StatusNet-MessageType: (message|subscribe|nudge|fave|mention)
>
> This would allow for easy mail filtering of status.net messages.  I'm
> happy to change any of the above if people think that there is a better
> way of doing it, I just this kept it pretty simple.
>
> While looking through the code I noticed that the function
> mail_to_user() (lib/mail.php 141 in my current dev env) would need to be
> modified to allow the adding of headers to messages when the function is
> called.  I would propose that instead of the 4th argument being $headers
> = array, that $address = null becomes the forth argument and $headers is
> inserted as the 3rd, like so:
> function mail_to_user(&$user, $subject, $body, $headers =
> array(),$address=null)
>
> I am proposing this as only 2 functions call this method using the
> address argument, so they can be easily patched, yet 5 functions will be
> calling the function with the headers argument.  Think the most common
> uses should involve the simplest calls.
>
> I'd like some feedback on this before starting to hack on it.
>
> Cheers
>
> Dave

This idea sounds fine to me.

However, with your implementation approach, you would have 5 functions to
modify, and all would create a headers array and pass that along, and the
code for these 5 functions would be very similar. Is there another way you
could do this, perhaps in the mail_to_user() function itself, so that the
headers array is created once? That way, when we want to add new items, it
will be easier, and new code won't have to copy/paste how to create the
headers array from existing code.

Please develop it against the 0.9.x branch and submit a merge request when
you're done. I'm actually pretty psyched - it means I could automate some
of my own mail processing flow.

Thanks,
~Craig

_______________________________________________
StatusNet-dev mailing list
[email protected]
http://lists.status.net/mailman/listinfo/statusnet-dev

Reply via email to