Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add twictures support to received messages

  • Loading branch information...
commit a8cc6ee94adb620458b5b1f126f2feb4c9b9ee55 1 parent 49ed230
@defunkt authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 ircamp.py
View
11 ircamp.py
@@ -56,10 +56,19 @@ def filter(self):
class ImageFilter(CampfireMessageFilter):
def filter(self):
image = self.soup.find('img')
+
if image:
- self.message['message'] = str(image['src'])
+ url = str(image['src'])
+ if "twictur.es" in url:
+ url = self.twicture_url(url)
+ self.message['message'] = url
+
return self.message
+ def twicture_url(self, image):
+ return image.replace('/i/', '/r/').replace('.gif', '')
+
+
class LinkFilter(CampfireMessageFilter):
def filter(self):
Please sign in to comment.
Something went wrong with that request. Please try again.