MMS prepends a 1 that needs to get stripped

This commit is contained in:
epall 2008-06-13 10:27:58 -07:00 committed by Eric Allen
parent 920507441d
commit dc0c5bffa4
2 changed files with 4 additions and 2 deletions

View file

@ -2,7 +2,9 @@ class SMSGateway < ActionMailer::Base
CONTEXT_NAME = 'Inbox'
def receive(email)
user = User.find(:first, :include => [:preference], :conditions => ["preferences.sms_email = ?", email.from[0].strip])
logger.info "Receiving SMS task from #{email.from[0].strip} For user #{user.nil? nil : user.login}"
if user.nil?
user = User.find(:first, :include => [:preference], :conditions => ["preferences.sms_email = ?", email.from[0].strip[1,100]])
end
return if user.nil?
context = user.prefs.sms_context

View file

@ -1,6 +1,6 @@
Return-Path: <15555555555/TYPE=PLMN@tmomail.net>
Date: Fri, 6 Jun 2008 21:38:26 -0400
From: 5555555555@tmomail.net
From: 15555555555@tmomail.net
To: gtd@tracks.com
Message-ID: <3645873.13759311212802713215.JavaMail.mms@rlyatl28>
Subject: This is the subject