fixes #100
This commit is contained in:
parent
7c841430a2
commit
6d7d3cbc9d
2 changed files with 7 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os, sys, pickle, subprocess
|
||||
from PyQt4 import QtCore, QtGui, QtWebKit
|
||||
import Windows, Helper
|
||||
|
@ -137,9 +138,10 @@ class Controller(QtCore.QObject):
|
|||
self.app.new_message_windows.append(new_message_window)
|
||||
|
||||
def sendMessage(self, message):
|
||||
text = str.replace(str(message.text), "\\", "\\\\")
|
||||
text = str.replace(text, "\"", "\\\"")
|
||||
text = str.replace(text, "\n", "\\n")
|
||||
text = message.text
|
||||
text = unicode.replace(text, "\\", "\\\\")
|
||||
text = unicode.replace(text, "\"", "\\\"")
|
||||
text = unicode.replace(text, "\n", "\\n")
|
||||
|
||||
in_reply_to_status_id = ""
|
||||
if message.inReplyTostatusId is not None:
|
||||
|
@ -164,7 +166,7 @@ class Controller(QtCore.QObject):
|
|||
if message.isPrivate:
|
||||
isPrivate = "true"
|
||||
|
||||
func = "tentia_instance.sendNewMessage(\"{}\", \"{}\", \"{}\", {}, {}, {});".format(text, in_reply_to_status_id, in_reply_to_entity, locationObject, imageFilePath, isPrivate)
|
||||
func = ("tentia_instance.sendNewMessage(\"" + text + "\", \"{}\", \"{}\", {}, {}, {});").format( in_reply_to_status_id, in_reply_to_entity, locationObject, imageFilePath, isPrivate)
|
||||
self.app.timeline.evaluateJavaScript(func)
|
||||
|
||||
@QtCore.pyqtSlot(str, str)
|
||||
|
|
|
@ -349,7 +349,7 @@ class NewPost(Helper.RestorableWindow):
|
|||
count = 256 - len(self.textInput.toPlainText())
|
||||
if count >= 0:
|
||||
message = Helper.PostModel()
|
||||
message.text = self.textInput.toPlainText()
|
||||
message.text = unicode(self.textInput.toPlainText().toUtf8(), "utf-8")
|
||||
message.inReplyTostatusId = self.status_id
|
||||
message.inReplyToEntity = self.reply_to_entity
|
||||
message.location = None
|
||||
|
|
Reference in a new issue