Commit Graph

32 Commits

Author SHA1 Message Date
Anna Schumaker 1bc6d1064f Put channel id on same line as "Reply above this line"
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-28 14:05:43 -04:00
Anna Schumaker 65e5403165 Merge consecutive messages with the same author
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-28 13:51:23 -04:00
Anna Schumaker 7b78e9d785 Move Message class into the chat namespace
It makes more sense to put it here, since it's related to chatting.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-28 13:24:36 -04:00
Anna Schumaker dcd8650e1a Message display improvements
- Put time and poster information on one line
- Wrap message text to 70 characters

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-28 13:21:38 -04:00
Anna Schumaker 193107574f Simplify hour:minute:second display
Now it's a bit easier to read!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-28 12:31:29 -04:00
Anna Schumaker d905ebd375 Remove X-Slack-Channel from email headers
Turns out, gmail doesn't preserve this when replying to messages.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-28 12:25:30 -04:00
Anna Schumaker 5fe26ca0e5 Send email with X-Slack-Header to specify channel
This is slightly more accurate than using channel names to lookup where
to post.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-27 16:37:37 -04:00
Anna Schumaker d43f0e52d8 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>
2015-05-27 16:18:50 -04:00
Anna Schumaker 29815fc28b slackpost: Properly strip out reply markers
Remove all lines beginning with ">", and the line immediately before
them.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-27 11:11:35 -04:00
Anna Schumaker d07bf33f44 Use the python url parser for encoding arguments
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-27 10:36:23 -04:00
Anna Schumaker e0d1c85259 Prefer real names for users
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-27 09:15:22 -04:00
Anna Schumaker b30600b066 Email should show up as the team name
And not as "SlackMail"

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-27 09:13:00 -04:00
Anna Schumaker ea0eeeb46c Send email to the authenticated user's email address
This is better than hardcoding in my address.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-27 09:12:05 -04:00
Anna Schumaker bbe14fa88d slack: change directory before running
To help find the tokens file, mostly

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 21:32:00 -04:00
Anna Schumaker 6110e5ff3b slackpost.py: Write a script for posting to slack
The idea is that postfix will pipe an email message into this script,
which will then post the reply to slack.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 21:21:46 -04:00
Anna Schumaker d9a6858be8 Mark channels read when updated
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 21:21:45 -04:00
Anna Schumaker 253e0374f0 Mark channels read when updated
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 17:04:56 -04:00
Anna Schumaker b5d715096e Prepare text as an email message
Right now it's hardcoded to send to me.  This should be made
configurable eventually ...

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 16:52:55 -04:00
Anna Schumaker 80706b18c9 Make a list of strings to hold the text
This will be the body of the email message.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 16:42:40 -04:00
Anna Schumaker 776ad5b1fa slack: Add users.info support and a User class
For finding information about users.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 16:36:46 -04:00
Anna Schumaker 48baf65574 slack: Add the channels.history() function and a Message class
For finding unread messages.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 16:02:36 -04:00
Anna Schumaker 4eb177cd8f slack: Find extra channel information if needed
This is mostly to find unread count and timestamp

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 15:44:52 -04:00
Anna Schumaker 23ac359ad7 slack: Add channels module and Channel class
This patch begins a new main loop using the new Channel class.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 15:21:13 -04:00
Anna Schumaker 02b610e671 slack: Add a wrapper for the auth API call
This module sets up the token to be used for most API calls.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 15:15:36 -04:00
Anna Schumaker f5af3107d5 slack: Begin API wrapper directory
I think this will make things easier to work with overall

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 14:40:01 -04:00
Anna Schumaker 0892ec28e7 Use team name instead of [SlackMail] for temporary file paths
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 14:00:36 -04:00
Anna Schumaker fdc2c9970e Write unread messages to a temporary file
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 12:41:34 -04:00
Anna Schumaker 11a777cb76 Add timestamps to message output
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 12:26:39 -04:00
Anna Schumaker a6ccb45f83 Fetch all unread messages from slack, along with user names
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 11:39:26 -04:00
Anna Schumaker 9065d67acb Find channel info and print unread messages
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 11:14:18 -04:00
Anna Schumaker 883504da38 Decode reply from slack into a python dictionary structure
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 09:44:55 -04:00
Anna Schumaker 13050a1486 Initial commit
Call the api.test and auth.test methods using a token from the file
"token" in the current directory.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 09:25:29 -04:00