jpasqua / VisibleTesla

Java App to monitor and Control the Tesla Model S
125 stars 41 forks source link

Missing subject since 2014-01-03 04:43:22 #50

Closed sunejak closed 10 years ago

sunejak commented 10 years ago

Hi.

The notification e-mails used to have a subject, but after this date they are gone. The issue seems to be in NotifierController.java line 236, where I assume that you want the first 80 characters, but instead you do characters from index 80.

    if (!mailer.send(addr, StringUtils.substring(msg, 80), date + "\n" + msg)) {

http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#substring(java.lang.String, int)

BUT it should probably read:

    if (!mailer.send(addr, msg.substring(0,(msg.length() > 80) ? 80 : msg.length(), date + "\n" + msg)) {

I tried to building it myself, but run out of time....