Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: stml/offbot
base: e3df6c212d
...
head fork: stml/offbot
compare: ded7ba9345
  • 8 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
View
8 app/controllers/listener_controller.rb
@@ -1,24 +1,28 @@
class ListenerController < ApplicationController
skip_before_filter :verify_authenticity_token
+ skip_before_filter :authenticate_person!
def receive_email
# do i need this? *scratches head*
@params = params
sent_to = params["to"].split('@')
- message_id = sent_to[0].split('.')[0]
+ message_id = sent_to[0].split('.')[1]
email_message = EmailMessage.find_by_message_id(message_id)
person = email_message.person
project = email_message.project
@update = Update.new(:body => params["text"], :email_message_id => email_message.id, :person_id => person.id, :project_id => project.id)
respond_to do |format|
- if @update.save && request.post?
+ if @update.save
flash[:notice] = 'Sucessful Post.'
+ format.html
format.xml { render :xml => @update.xml, :status => :ok }
+ format.json { render :json => @update.json, :status => :ok }
else
flash[:error] = 'There was an error with saving the post'
format.xml { render :xml => @update.errors, :status => :unprocessable_entry }
+ format.json { render :json => @update.errors, :status => :unprocessable_entry }
end
end
View
0  app/views/listener/receiving_email.html.haml
No changes.

No commit comments for this range

Something went wrong with that request. Please try again.