Skip to content

Commit

Permalink
Fixed major glitch with SMS app
Browse files Browse the repository at this point in the history
  • Loading branch information
tyspa1 committed May 13, 2015
1 parent c5a2a8b commit 2e4f63f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions apps/message/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ def get_sms(self):
self.sms_messages['senders'][index] = i[0]
index += 1

#If there are less than two messages, do some configuring
if int(num_sms) < 2:
self.sms_messages['senders'].append('')
self.sms_messages['messages'].append('')
if int(num_sms) == 0:
self.sms_messages['senders'].append('')
self.sms_messages['messages'].append('')

def config_sms(self):
self.blit['surfaces'][1] = self.font.render(self.sms_messages['senders'][(self.page + 1) * -1] + ' says...', True, self.BLACK, self.WHITE)
Expand Down
3 changes: 2 additions & 1 deletion apps/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def on_first_run(self):
self.exit = False

def delete_sms(self):
print 'Deleting SMS messages!'
self.fona.transmit('AT+CMGD=1,4')
self.exit = True

def set_headset(self):
if self.headset:
Expand Down
5 changes: 5 additions & 0 deletions src/receive.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def check(self, update):
num_sms = self.fona.transmit('AT+CPMS?')
num_sms = num_sms[1]
num_sms = num_sms[14:16]
num_sms = num_sms.strip(',')
try:
num_sms = int(num_sms)
if num_sms > self.total_sms:
Expand All @@ -60,6 +61,10 @@ def check(self, update):
except:
print 'Error calculating sms quanity'
update = True

else:
self.call_coming = False
update = True

if self.call_coming:
self.incoming_call()
Expand Down

0 comments on commit 2e4f63f

Please sign in to comment.