Update reply handler

What we really want to do is look for the first line beginning with ">"
and discard everything after it (and the line immediately before it,
just to be safe)

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-05-27 16:18:08 -04:00
parent 29815fc28b
commit d43f0e52d8
1 changed files with 6 additions and 6 deletions

View File

@ -26,12 +26,12 @@ if channel == None:
sys.exit(1)
lines = headers.get_payload().strip().split("\n")
for i in range(len(lines)):
if len(lines[i]) == 0:
continue
if lines[i][0] == ">":
break
# Strip out quoted text
if lines[-1][0] == ">":
while lines[-1][0] == ">":
lines.pop(-1)
lines.pop(-1)
lines = lines[0:i-1]
text = ' '.join(lines).strip()
channel.post(text)