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:
parent
29815fc28b
commit
d43f0e52d8
12
slackpost.py
12
slackpost.py
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue