Skip to content

Commit

Permalink
Added the MIT licence
Browse files Browse the repository at this point in the history
  • Loading branch information
st3fan committed Sep 3, 2014
1 parent 49413bd commit dcf934b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Stefan Arentz <stefan@arentz.ca>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
32 changes: 30 additions & 2 deletions xapsd
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
#!/usr/bin/python

#!/usr/bin/env python

#
# The MIT License (MIT)
#
# Copyright (c) 2014 Stefan Arentz <stefan@arentz.ca>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

import collections
import hashlib
import sys
import OpenSSL.crypto as crypto

from twisted.web.xmlrpc import Proxy
from twisted.python import log
from twisted.python.filepath import FilePath
from twisted.internet.protocol import ServerFactory
Expand Down Expand Up @@ -47,6 +71,7 @@ class EmailPushNotificationProtocol(LineOnlyReceiver):
def __init__(self, databasePool, topicName):
self.databasePool = databasePool
self.topicName = topicName
self.proxy = Proxy('http://localhost:7077/')

#
# Handle the REGISTER command. It looks as follows:
Expand Down Expand Up @@ -94,6 +119,9 @@ class EmailPushNotificationProtocol(LineOnlyReceiver):

def handleNotify(self, command):
log.msg("handleNotify: " + str(command))

self.proxy.callRemote('notify', "com.apple.mobilemail", "361E1CF19D03E6A3380AB34B83399F1123FF523F9AC7AB2F3ADA531DDD9A96C1", {'aps':{'account-id': '1B737D45-5B98-48B0-BD2F-571343D03F85'}})

return ("OK", "")

def lineReceived(self, line):
Expand Down

0 comments on commit dcf934b

Please sign in to comment.