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
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os, sys, pickle, subprocess
|
import os, sys, pickle, subprocess
|
||||||
from PyQt4 import QtCore, QtGui, QtWebKit
|
from PyQt4 import QtCore, QtGui, QtWebKit
|
||||||
import Windows, Helper
|
import Windows, Helper
|
||||||
|
@ -137,9 +138,10 @@ class Controller(QtCore.QObject):
|
||||||
self.app.new_message_windows.append(new_message_window)
|
self.app.new_message_windows.append(new_message_window)
|
||||||
|
|
||||||
def sendMessage(self, message):
|
def sendMessage(self, message):
|
||||||
text = str.replace(str(message.text), "\\", "\\\\")
|
text = message.text
|
||||||
text = str.replace(text, "\"", "\\\"")
|
text = unicode.replace(text, "\\", "\\\\")
|
||||||
text = str.replace(text, "\n", "\\n")
|
text = unicode.replace(text, "\"", "\\\"")
|
||||||
|
text = unicode.replace(text, "\n", "\\n")
|
||||||
|
|
||||||
in_reply_to_status_id = ""
|
in_reply_to_status_id = ""
|
||||||
if message.inReplyTostatusId is not None:
|
if message.inReplyTostatusId is not None:
|
||||||
|
@ -164,7 +166,7 @@ class Controller(QtCore.QObject):
|
||||||
if message.isPrivate:
|
if message.isPrivate:
|
||||||
isPrivate = "true"
|
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)
|
self.app.timeline.evaluateJavaScript(func)
|
||||||
|
|
||||||
@QtCore.pyqtSlot(str, str)
|
@QtCore.pyqtSlot(str, str)
|
||||||
|
|
|
@ -349,7 +349,7 @@ class NewPost(Helper.RestorableWindow):
|
||||||
count = 256 - len(self.textInput.toPlainText())
|
count = 256 - len(self.textInput.toPlainText())
|
||||||
if count >= 0:
|
if count >= 0:
|
||||||
message = Helper.PostModel()
|
message = Helper.PostModel()
|
||||||
message.text = self.textInput.toPlainText()
|
message.text = unicode(self.textInput.toPlainText().toUtf8(), "utf-8")
|
||||||
message.inReplyTostatusId = self.status_id
|
message.inReplyTostatusId = self.status_id
|
||||||
message.inReplyToEntity = self.reply_to_entity
|
message.inReplyToEntity = self.reply_to_entity
|
||||||
message.location = None
|
message.location = None
|
||||||
|
|
Reference in a new issue