tax / pywhatsapp

Simple wrapper around yowsup to send a message or mediafile with whatsapp
Other
63 stars 23 forks source link

How can we get the status of message ? #3

Closed AShabana closed 8 years ago

AShabana commented 8 years ago

Dear tax , how can I get from your amazing lib the status of message sent client.send_message(mobile, text), i.e. delivered, undelivered , delivered_and_opened

marcoscabrera commented 8 years ago

hello Ashabana i like wondering to you if this lib actually is working ?

tax commented 8 years ago

Hi @AShabana this is just a really simple wrapper so this functionality is not available. But please feel free to add a pull request :wink:

AShabana commented 8 years ago

I leave this project from a while but @marcoscabrera I modified the lib file diff lib/python2.7/site-packages/whatsapp.py lib/python2.7/site-packages/whatsapp.py.origin 8c8

< from yowsup.layers.auth import YowCryptLayer, YowAuthenticationProtocolLayer, AuthError

from yowsup.layers.auth import YowAuthenticationProtocolLayer 12,16d11 < from yowsup.layers.stanzaregulator import YowStanzaRegulator < from yowsup.layers.protocol_receipts import YowReceiptProtocolLayer < from yowsup.layers.protocol_acks import YowAckProtocolLayer < from yowsup.layers.logger import YowLoggerLayer < from yowsup.layers.protocol_messages import YowMessagesProtocolLayer 141,154c136,137 < from yowsup.layers.axolotl import YowAxolotlLayer < layers = ( < SendLayer, < (YowAuthenticationProtocolLayer, YowMessagesProtocolLayer, YowReceiptProtocolLayer, YowAckProtocolLayer), < YowAxolotlLayer, < YowLoggerLayer, < YowCoderLayer, < YowCryptLayer, < YowStanzaRegulator, < YowNetworkLayer < ) < credentials = (self.login, self.password) < self.stack = YowStack(layers)

< self.stack.setProp(SendLayer.PROP_MESSAGES, message)

    layers = (SendLayer,) + (YOWSUP_PROTOCOL_LAYERS_FULL,) + YOWSUP_CORE_LAYERS
    self.stack = YowStack(layers)

156c139,144

< self.stack.setCredentials(credentials)

    self.stack.setProp(YowAuthenticationProtocolLayer.PROP_CREDENTIALS, (self.login, self.password))
    self.stack.setProp(YowNetworkLayer.PROP_ENDPOINT, YowConstants.ENDPOINTS[0])
    self.stack.setProp(YowCoderLayer.PROP_DOMAIN, YowConstants.DOMAIN)
    self.stack.setProp(YowCoderLayer.PROP_RESOURCE, env.CURRENT_ENV.getResource())

    self.stack.setProp(SendLayer.PROP_MESSAGES, [([to, message, is_media])])
AShabana commented 8 years ago

fyi I tried the original code from yowsup today and seem not work also !!!

https://github.com/tgalal/yowsup/issues/1232