- self._conn.session.backend.send_sms(self._otherHandle.phoneNumber, text)
- self._conn.session.conversationsStateMachine.reset_timers()
+ if not self.__hasServerBeenPolled:
+ # Hack: GV marks messages as read when they are replied to. If GV
+ # marks them as read than we ignore them. So reduce the window for
+ # them being marked as read. Oh and Conversations already handles
+ # it if the message was already part of a thread, so we can limit
+ # this to if we are trying to start a thread. You might say a
+ # voicemail could be what is being replied to and that doesn't mean
+ # anything. Oh well.
+ try:
+ self._conn.session.texts.update(force=True)
+ except Exception:
+ _moduleLogger.exception(
+ "Update failed when proactively checking for texts"
+ )
+
+ _moduleLogger.info("Sending message to %r" % (self.__otherHandle, ))
+ self._conn.session.backend.send_sms([self.__otherHandle.phoneNumber], text)
+ self._conn.session.textsStateMachine.reset_timers()