Hello..
You have an excellent framework here, and I'm looking to help. :)
First off, a couple things I noticed with the Verizon US cleanup. I tested things w/ three different phone models through their MMS service.
1) The subject given to the MMS message is the mail subject. This must have changed as I saw you had the following code to replace the "generic subject" that you saw:
$node->title = truncate_utf8($body, 60, TRUE, TRUE);
I think that could be safely removed for Verizon MMS US. I just put in a few different rules to take care of users being lazy (or dumb :) ):
// Lets clean up if the author just puts the title in the body
if (empty($node->title) && !empty($node->body) && strlen($node->body) <= 60) {
$node->title = $node->title = truncate_utf8($body, 60, TRUE, TRUE);
$node->body = "";
}
// What if there is no title and just a longer description
if (empty($node->title) && !empty($node->body) $node->title = truncate_utf8($body, 60, TRUE, TRUE);
// OK how about a really lazy author
if (empty($node->title) && empty($node->body)) $node->title = "Mobile Submission";
2) I see you saw a TXT attachment of the body named "smiltextpartfilename0.txt" and a question about that being phone dependent. Well, it is. My Motorola Q attaches one thats $random_number$.txt, and the other phones I tried didn't attach anything. I just decided to strip out all the 'text/plain' inclusions with:
// Get rid of extra text attachments
foreach ($node->mailsave_attachments as $key => $file) {
if ($file['filemime'] == 'text/plain') {
unset($node->mailsave_attachments[$key]);
}
}
Now for the good news :) I have a plugin working for mailsave that turns the attached JPGs into CCK imagefied items. At the moment it works fine, but a few things are hardcoded still which I need to replace.
The one thing that has me puzzled is that in looking at your mailsave_to_image example it seems that $node->type should be set at that point. However I don't see it in $node, and I would need that to lookup some CCK information. Should that always be set at that point? or only if the type has been forced through mailhandler tags?
Thanks again...
-James
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | mms_us_verizon.inc_.diff | 1.43 KB | Moonshine |
Comments
Comment #1
Moonshine commentedI had a little type in the code above so I'll just include the diff from the mms_us_verizon.inc file I'm using.
-James
Comment #2
Moonshine commentedSorry for the hassle... $node->type seems to be available so I should be able to wrap this up and will post soon.
Comment #3
Stuart Greenfield commentedThanks for the post! The whole reason for updating mailsave to a modular system was to enable other plug-ins - looking forward to seeing the CCK module!
In terms of filters for post from mobile phone, this is a recent addition to mailsave, and is a "work in progress" - I don't yet have enough samples from enough networks and mobiles to have got even close to fine tuning it. It's interesting to hear what you've found with Verizon / phone combinations.
I will have to keep an eye on how things develop - maybe there will just have to be many filters to cover many combinations - it's a bit of a shame if that happens as it would be nice to shield the "average" user from having to code their own.
Cheers!
Stuart
PS - yes, $node->type is set by mailsave_to_image, if the conversion attempt fails it resets back to whatever type was originally in use. This is done at line 95 of the module.
Comment #4
Stuart Greenfield commentedCommitted the Verizon filter changes to HEAD.
Mailsave to CCK imagefield has been released separately.
Change to Telia module to do, then I'll release this.
Thanks!
Comment #5
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.