1

chg: paste in muc-filter

This commit is contained in:
diSabler
2015-03-04 18:59:03 +03:00
parent ab140aac85
commit e293a2c30c
2 changed files with 9 additions and 2 deletions

View File

@@ -659,10 +659,17 @@ def muc_filter_action(act,jid,room,reason):
return None
def paste_text(text,room,jid):
return paste_text_raw(text,room,jid,True)
def paste_text_muc(text,room,jid):
return paste_text_raw(text,room,jid,False)
def paste_text_raw(text,room,jid,need_replace):
nick = get_nick_by_jid_res(room,jid)
_html_paste = GT('html_paste_enable')
if _html_paste:
text = html_escape(text).replace(' ',' ')
if need_replace: text = html_escape(text).replace(' ',' ')
else: text = html_escape(text)
nick = html_escape(nick)
paste_header = ['','<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link href="%s" rel="stylesheet" type="text/css" /><title>\n' % paste_css_path][_html_paste]
url = '%s%s' % (str(hex(int(time.time()*100)))[2:-1],['.txt','.html'][_html_paste])