Coder Social home page Coder Social logo

hoehermann / purple-gowhatsapp Goto Github PK

View Code? Open in Web Editor NEW
276.0 19.0 34.0 687 KB

Pidgin/libpurple plugin for WhatsApp Web.

License: GNU General Public License v3.0

C 54.33% Go 39.86% CMake 4.56% Shell 1.25%
pidgin-plugins libpurple-plugin pidgin libpurple instant-messaging whatsapp-web whatsapp-api whatsapp pidgin-plugin

purple-gowhatsapp's Introduction

purple-gowhatsapp

A libpurple/Pidgin plugin for WhatsApp. Being developed on Ubuntu 22.04.

This is a re-write of purple-gowhatsapp, switching back-ends from go-whatsapp to whatsmeow. whatsmeow is written by Tulir Asokan. It has multi-device support.

Instant Message

Download

Features

Standard features:

  • Connecting to existing account via QR-code.
  • Receiving messages, sending messages.
  • Receiving files (images, videos, voice, document, stickers).
  • Received images are displayed in the conversation window (optional).
  • Sending images as image messages.
  • Sending opus audio files as voice messages.
  • Sending mp4 video files as video messages.
  • Sending other files as documents.
  • Fetching all contacts from account, showing friendly names in buddy list, downloading profile pictures (Markus "nihilus" Gothe for Peter "theassemblerguy" Bachmaier).
  • Sending receipts (configurable).
  • Displaying reactions.
  • Support for socks5 proxies.
  • Reasonable support for group chats by yourealwaysbe.
  • Under the hood: Reasonable callback mechanism thanks to Eion Robb.

Major differences from the go-whatsapp vesion:

  • Incoming messages are not filtered (formerly by Daniele Rogora, now whatsmeow keeps track of already received messages internally).
  • Note: Under the hood, gowhatsapp and whatsmeow use completely different prototocls. For this reason, one must establish a new session (scan QR-code) when switching. All old (non-multi-device) sessions will be invalidated. This is a technical requirement.
  • Note: This is not a perfect drop-in replacement for the plug-in with the gowhatsapp back-end. For this reason, it has a different ID: prpl-hehoe-whatsmeow

Other improvements:

  • Contact presence is regarded (buddies are online and offline).
  • Typing notifications are handled.
  • Logging happens via purple.
  • Messages which only consist of a single URL may be sent as media messages (disabled by default).
  • Account can be logged out via purple action.
  • Reactions are displayed as messages.
  • There is an "away" state.
    • For compatibility with the auto-responder plug-in.
    • Other devices (i.e. the main phone) display notifications while plug-in connection is "away".
    • WhatsApp does not send contact presence updates while being "away".
    • Caveat emptor: Other side-effects may occur while using "away" state.

Known issues:

  • Contacts:
    • If someone adds you to their contacts and sends you the very first message, the message will not be received. WhatsApp Web shows a notice "message has been delayed – check your phone". This notice is not shown by the plug-in.
  • Group Chats:
    • Purple prior to 2.14.0 cannot send files to groups.
    • No notification when being added to a group (the chat will be entered upon receiving a message).
    • The list of participants is not updated if a participants leaves the chat (on Pidgin, closing the window and re-entering the chat triggers a refresh).
  • Stickers:
    • A webp pixbuf loader must be present at runtime.
    • GDK pixbuf headers must be available at build time else presence of loader cannot be checked.
    • Stickers are not animated.
  • Special messages:
    • Voice calls are not supported (a warning is displayed).
    • Votes are not supported (a warning is displayed).
    • Other special messages are irgnored silently.
  • No support for mark-up in outgoing messages.
    Note: Due to the internal use of purple_markup_strip_html, you need to use a br-tag instead of newline. Pidgin does that automatically, but other clients might not.
  • Emojis: WhatsApp supports many emojis in text message bodies and reactions. The smiley themes shipped with Pidgin do not cover all emojis. You can install a smiley theme or a font which does, for example the Google Noto Color Emoji font. On Ubuntu, this is provided by the fonts-noto-color-emoji package. There is currently no experience if that works on Windows as well. Feedback is welcome.

Other planned features:

  • Support WhatsApp formatting.
  • Display receipts in conversation window.
  • Join group chat via link.
  • View group icon.
  • Gracefully handle group updates.
  • Action to refresh groups.
  • Support sending mentions.
  • Support replying to a specific message.

These features will not be worked on:

  • Accessing microphone and camera for recording voice or video messages.
    To prepare a voice message, you can use other tools for recording. I like to use ffmpeg:

    ffmpeg -f pulse -i default -ac 1 -ar 16000 -c:a libopus -y voicemessage.ogg # on Linux with PulseAudio
    

Building

Linux

Dependencies:

  • pidgin (libpurple glib gtk)
  • pkg-config
  • cmake (3.8 or newer)
  • make
  • go (1.21 or newer)
  • gcc (9.2.0 or newer)
  • libgdk-pixbuf-2.0 (optional)
  • libopusfile (optional)

For Ubuntu, or Debian compliant Linux flavors, use the apt package manager to install these dependencies first:

sudo apt install pidgin pkg-config cmake make golang gcc libgdk-pixbuf2.0-dev libopusfile-dev

This project uses CMake.

git submodule update --init
mkdir build
cd build
cmake ..
cmake --build .
sudo make install/strip

Note: If you configure the project for using user-specific installation paths before building, you may install without sudo:

cmake -DPURPLE_DATA_DIR:PATH=~/.local/share -DPURPLE_PLUGIN_DIR:PATH=~/.purple/plugins ..

In the build directory, you can also create a Debian package:

cpack

You should not do that with user-specific paths, obviously.

Windows Specific

CMake will try to set-up a development environment automatically.

Additional dependencies:

This is known to work with MSYS make and CMake generator "MSYS Makefiles". go and gcc must be in %PATH%.
At time of writing, cgo does not support MSVC.

For sending opus in ogg audio files as voice messages, add a static win32 build of opusfile to CMake's prefix path or use vcpkg's toolchain file:

vcpkg.exe install opusfile:x86-mingw-static
cmake -DCMAKE_TOOLCHAIN_FILE="wherever/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x86-mingw-static -DVCPKG_MANIFEST_MODE=OFF -G "MSYS Makefiles" ..

Installation

  • Place the binary in your Pidgin's plugin directory (on Linux, that is ~/.purple/plugins).

Set-Up

  • Create a new account
    You must enter your phone's internationalized number followed by @s.whatsapp.net.
    Example: 123456789 from Germany would use [email protected].

  • Upon login, a QR code is shown in a Pidgin request window.
    Using your phone's camera, scan the code within 20 seconds – just like you would do with WhatsApp Web.
    Note: On headless clients such as Spectrum, the QR code will be wrapped in a message by a fake contact called "Logon QR Code". You may need to temporarily configure your UI to accept messages from unsolicited users for linking purposes.
    Wait until the connection has been fully set up. Unfortunately, there is no progress indicator while keys are exchanged and old messages are fetched. Usually, a couple of seconds is enough. Some power users with many groups and contacts reported the process can take more than a minute. If the plug-in is not yet ready, outgoing messages may be dropped silently (see issue #142).

Purple Settings

  • qrcode-size
    The size of the QR code shown for login purposes, in pixels (default: 256). When set to zero, the QR code will be delivered as a text message.

  • fetch-contacts
    If set to true (default), buddy list will be populated with contacts sent by server. This is useful for the first login in particular. If enabled while connecting, it will also fetch the current list of WhatsApp groups.

  • fake-online
    If set to true (default), contacts currently not online will be regarded as "away" (so they still appear in the buddy list). If set to false, offline contacts will be regarded as "offline" (no messages can be sent).

  • send-receipt
    Selects when to send receipts "double blue tick" notifications:

    • immediately: immediately upon message receival
    • on-interact: as the user interacts with the conversation window (only usable with Pidgin)
    • on-answer: as soon as the user sends an answer (default)
    • never: never
  • message-cache-size
    Stores a number (default: 100) of messages in local volatile memory. Cached messages are used to provide context when displaying reactions.

  • discard-old-messages
    If set to true (default: false), messages older than the connection will be discarded.
    Note: This is implemented without time-zone information. This might not work as expected when chatting with someone in a different time-zone.

  • handle-images
    What to do with images:

    • inline: embed in the conversation window
    • xfer: treat as file download
    • both: do both
  • inline-stickers
    If set to true (default), stickers will automatically be downloaded and may embedded in the conversation window if an appropriate webp GDK pixbuf loader is present.

  • group-is-file-origin
    It set to true (default), when a file is posted into a group chat, that chat will be the origin of the file. If set to false, the file will originate from the group chat participant. At time of writing, Bitlbee wants this to be false.
    Note: File transfers for group chats are supported since libpurple 2.14.0.

  • attachment-message
    This system message is written to the conversation for each incoming attachment. It can have two %s place-holders which wil be fed into a call to printf.

    1. The first %s will be replaced by the original sender (the participant, not the group chat).
    2. The second %s will be replaced by the original document file name. For non-document attachments, this falls back to the hash mandated by WhatsApp.

    Default value is Preparing to store "%s" sent by %s....

    If built and used in a Linux environment with GLib 2.68 or newer, you can also use place-holders for more flexibility:

    • $sender: Denotes the original sender (the participant, not the group chat).
    • $filename: Refers to the original document file name. For non-document attachments, this falls back to the hash mandated by WhatsApp.
  • get-icons
    If set to true (default: false), profile pictures are updated every time the plug-in connects.

  • ignore-status-broadcast
    If set to true (default), your contact's status broadcasts are ignored.

  • bridge-compatibility
    Special compatibility setting for protocol bridges like Spectrum or bitlbee. Setting this to true (default: false) will treat system messages just like normal messages, allowing them to be logged and forwarded. This only affects soft errors regarding a specific conversation, e.g. "message could not be sent".

  • echo-sent-messages
    Selects when to put an outgoing message into the local conversation window:

    • internal: After the WhatsApp server has received the message, and lock-up the UI until it does (default).
    • on-success: After the WhatsApp server has received the message, but do not lock-up the UI (use this for speed).
    • immediately: Immediately after hitting send (message may not actually have been sent).
    • never: Never (some protocol bridges want this).

    Note: Neither of these indicate whether the message has been received by the contact.

  • autojoin-chats
    Automatically join all chats representing the WhatsApp groups after connecting and every time group information is provided. This is useful for protocol bridges.

  • database-address
    whatsmeow stores all session information in a SQL database.

    This setting can have place-holders:

    • $purple_user_dir: Will be replaced by the user directory, e.g. ~/.purple.
    • $username: Will be replaced by the username as entered in the account details.

    Default: file:$purple_user_dir/whatsmeow.db?_foreign_keys=on&_busy_timeout=3000
    Folder must exist, whatsmeow.db is created automatically.

    By default, the driver will be sqlite3 for a file-backed SQLite database. This is not recommended for multi-account-applications (e.g. spectrum or bitlbee) due to a limitation in the driver. The file-system (see addess option) must support locking and be responsive. Network shares (especially SMB) do not work.

    If the setting starts with postgres:, the suffix will be passed to database/sql.Open as dataSourceName for the pq PostgreSQL driver. At time of writing, there are no further drivers supported by whatsmeow. Support for MySQL/MariaDB has been requested.

  • embed-max-file-size
    When set to a value greater than 0 (default, in megabytes), the plug-in tries to detect link-only messages such as https://example.com/voicemessage.oga for forwarding.

    If enabled, this plug-in tries to download and forward the linked file, choosing the appropriate media type automatically. This way, your contacts do not see a link to an image, video or a voice message, but instead can play the content directly in their app. The message must consist of one URL exactly, including whitespace. For this reason, this mode is incompatible with Pidgin's OTR plug-in, see this bug report.

    At time of writing, the maximum file-size supported by WhatsApp is 2 GB according to wabetainfo and confirmed by iOS users in Germany.

  • trusted-url-regex
    In case a link-only message does not point to an image, video or audio file, the file may be sent as a document message. For reasons of safety, this will only happen for files from trusted sources. An URL must match this regular expression to be considered trustworthy. Matching is case-sensitive. The match spans the entire verbatim URL, so query and fragment need to be considered. Do not forget the caret and/or dollar sign. Some examples:

    • ^https://www\.example\.com trust files from www.example.com via HTTPS.
    • ^https://[^/]*example\.com trust files from example.com and subdomains, authentication data via HTTPS.
    • ^[^?#]+\.pdf$ trust all PDFs.
    • ^[^?#]+\.(pdf|png)$ trust all PDFs and PNGs.
    • ^https://www\.example\.com[^?#]+\.(pdf|png)$ trust all PDFs and PNGs from https://www.example.com.
    • .* trust anything.
    • ^$ trust nothing (default).

    In case of image, video or audio files, further conditions need to be met, see below.

Notes

Conditions for Sending Media Messages

WhatsApp is very picky about media messages. This is actually a good thing for ensuring compatibility on all devices and clients (Android, iOS, all browsers for WhatsApp Web…).

Image Message

An image may be sent as an image message (JPEG, image/jpeg). This is relatively straight-forward.

Voice Message

This feature is only available if the plug-in has been built with liboggfile.

A voice message must meet these criteria:

  • Mime-Type: application/ogg, audio/ogg, sent as audio/ogg; codecs=opus
  • Container: ogg
  • Codec: opus

Additional recommendations:

  • Channels: 1 (mono)

This kind of message is also known as "push to talk" (PTT). While it is possible to send other audio formats as non-voice audio messages, this plug-in only considers data for voice messages. Everything else is send as a document message.

Video Message

A video message must meet these criteria:

  • Mime-Type: video/mp4
  • Container Major Brand: mp42 (observed), isom (also accepted)
  • Moov Atom Location: Beginning (recommended)
  • Video Track:
    • Codec: h264
    • Pixel Format: yuv420p (assumed, not checked)
  • Audio Track (optional):
    • Codec: aac (not checked)

Not all of these values are checked by the plug-in. Some of these criteria are guessed and may not actually be WhatsApp restrictions.

Document Message

A file is sent as-is.

Proxy Support

whatsmeow offers support for SOCKS5 proxies only. Even if no proxy settings are set in purple, the underlying Go runtime might pick up the https_proxy environment variable anyway.

Slash Commands

This plug-in supports a couple of "IRC-style" commands. The user can write them in any chat. These features are experimental hacks. They have been included due to user reuqets. Use them with care.

  • ?versions
    Show version information.

  • ?contacts
    Request re-download of all contacts. Only affects the buddy list if fetch-contacts is set to true.

  • ?participants alias ?members
    Request the current list of participants. Can only be used in group chat conversations.

  • ?presenceavailable, ?presenceunavailable, ?presence
    Overrides the presence which is being sent to WhatsApp servers. The displayed connection state may no longer match the advertised connection state. This can be used to appear unavailable while still being able to receive messages for logging or notification purposes. Using this command may result in unexpected behaviour. Use /presence (without a suffix) to give back control to the plug-in's internals.

  • ?logout
    Performs a log-out. The QR-code will be requested upon connecting again.

Attachment Handling and Memory Consumption

Attachments (images, videos, voice messages, stickers, document) are always downloaded as soon as the message is processed. The user is then asked where they want the file to be written. During this time, the file data is residing in memory multiple times:

  • in the input buffer
  • in the decryption buffer
  • in the go → C message buffer
  • in the output buffer

On systems with many concurrent connections, this could exhaust memory.

As of writing, whatsmeow does not offer an interface to read the file in chunks.

Acknowledgements

purple-gowhatsapp's People

Contributors

beadon avatar blacklight avatar hackartists avatar hoehermann avatar vitalyster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

purple-gowhatsapp's Issues

libpurple and pidgin is not thread safe, goroutines can become threads

From Pidgin ticket #17425:

libpurple and pidgin are NOT thread safe. No goroutines aren't necessarily threads, but then can become threads, and I would guess that this is the source of the problem.

is being indicated as the source of hangs while composing/editing in the message box.

Any thoughts? Maybe because it needs to use go-whatsapp which means it needs to use Go which means it could yield use of threads, this plugin is a non-starter?

I cannot see my contacts anymore

I pulled the last git revision, and now I don't see my added whatsapp contacts anymore.
I created a group for these contacts, this group is now empty.

Build for Windows

I found a link to EionRobb's build for Windows in a closed issue. Would it be possible to provide a link to the Windows build on the main page so it is easier to find?

However, the current build doesn't seem to work for me. The fake conversation pops up, but is blank - there is no QR code to scan....

Windows 10 x64, latest build, Pidgin latest build (2.13.0)

Frequently crash of libgowhatsapp.dll

I added this protocol, QR code... it starts to add contacts. Crashes. Reopen pidgin, it works. I started to move buddies to sort buddies, after some time it crashes. Then I cannot reopen pidgin, every time it crashes. I disable protocol, open pidgin, wait some minutes, try to enable protocol - crash.
After about week, I tried again. Open, get messages, and several minutes later, crash.

Event log says:
Faulting application name: pidgin.exe, version: 2.13.0.0, time stamp: 0x00000000
Faulting module name: libgowhatsapp.dll, version: 0.0.0.0, time stamp: 0x5ea00288
Exception code: 0xc0000005
Fault offset: 0x00001b07
Faulting application path: C:\Program Files (x86)\Pidgin\pidgin.exe
Faulting module path: C:\Program Files (x86)\Pidgin\plugins\libgowhatsapp.dll

Group chats don't show who is saying what

In a group chat, everything said is reported as coming from the group name, not the name of the person in the group that said what was said.

I am sure you could imagine how difficult that makes following group chats.

Add logic for purple-3

It currently fails to build because it looks for purple, and not purple-3. Perhaps add some logic to the MAKEFILE to say PURPLE=purple-3

Connection state is not displayed reliably

This prpl's connection state is not displayed properly. Errors are sometimes disregarded. This lead to Pidgin end-user confusion as seen at #19 and #20. spectrum2 is affected too, as seen at #5 .

This prpl calls

purple_connection_set_state(pc, PURPLE_CONNECTION_CONNECTING);

and

purple_connection_set_state(pc, PURPLE_CONNECTED);

(in this order). Yet I never saw the "connecting" state regarded in Pidgin's UI.

This prpl calls

purple_connection_set_state(pc, PURPLE_DISCONNECTED);

when the connection is closed by user request.

All other disconnects happen implicitly due to errors reported by

purple_connection_error(pc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, "error description");

.

I do not know what I am doing wrong. It looks I need help by a purple veteran. @EionRobb, can you give me any pointers on this one?

Bitlbee: saving authentication

Hi,

I was able to get the plugin to work with purple/bitlbee, but have been having issues getting it to save the credentials after restarting the server.

e.g., add whatsapp account, do the qr code thing, account is active -- can chat. run save from the &bitlbee command channel. The account shows up in the user.xml file within the bitlbee conf directory, but nothing shows up in the purple directory other than the login file used for the qr code.

Is there a trick to getting the credentials to persist across bitlbee restarts?

Thanks

build warnings on Fedora 31

When I build on Fedora 31 I get these messages:

$ make update-dep
go get -u github.com/gabriel-vasile/mimetype
go get -u github.com/Rhymen/go-whatsapp
touch -d "Mon, 29 Jul 2019 12:49:11 +0200" /home/brian/go/pkg/linux_amd64/github.com/Rhymen/go-whatsapp.a
$ make
go get github.com/skip2/go-qrcode
go build -buildmode=c-archive -o purplegwa.a purplegwa.go purplegwa-media.go
cc -O2 -g -ggdb -pipe -Wall -std=c99 -DGOWHATSAPP_PLUGIN_VERSION='"0.1.0~git6930e00"' -DMARKDOWN_PIDGIN -DLOCALEDIR=\"/usr/share/locale\" -fPIC -shared -o libgowhatsapp.so libgowhatsapp.c purplegwa.a -Wl,-z,relro `pkg-config purple glib-2.0 --libs --cflags`  -Ipurple2compat
In file included from /usr/include/libpurple/media/codec.h:35,
                 from /usr/include/libpurple/media.h:31,
                 from /usr/include/libpurple/prpl.h:75,
                 from /usr/include/libpurple/buddyicon.h:39,
                 from /usr/include/libpurple/blist.h:110,
                 from /usr/include/libpurple/status.h:133,
                 from /usr/include/libpurple/connection.h:151,
                 from /usr/include/libpurple/account.h:49,
                 from /usr/include/libpurple/purple.h:48,
                 from purple_compat.h:19,
                 from libgowhatsapp.c:40:
/usr/include/libpurple/media/../util.h:1397:13: warning: const
 1397 | G_CONST_RETURN gchar *purple_gai_strerror(gint errnum);
      |             ^~~~~~~
In file included from /usr/include/libpurple/prpl.h:75,
                 from /usr/include/libpurple/buddyicon.h:39,
                 from /usr/include/libpurple/blist.h:110,
                 from /usr/include/libpurple/status.h:133,
                 from /usr/include/libpurple/connection.h:151,
                 from /usr/include/libpurple/account.h:49,
                 from /usr/include/libpurple/purple.h:48,
                 from purple_compat.h:19,
                 from libgowhatsapp.c:40:
/usr/include/libpurple/media.h:165:3: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
  165 |   guint num_params, GParameter *params);
      |   ^~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/libpurple/account.h:31,
                 from /usr/include/libpurple/purple.h:48,
                 from purple_compat.h:19,
                 from libgowhatsapp.c:40:
/usr/include/glib-2.0/gobject/gparam.h:271:8: note: declared here
  271 | struct _GParameter /* auxiliary structure for _setv() variants */
      |        ^~~~~~~~~~~
In file included from /usr/include/libpurple/prpl.h:75,
                 from /usr/include/libpurple/buddyicon.h:39,
                 from /usr/include/libpurple/blist.h:110,
                 from /usr/include/libpurple/status.h:133,
                 from /usr/include/libpurple/connection.h:151,
                 from /usr/include/libpurple/account.h:49,
                 from /usr/include/libpurple/purple.h:48,
                 from purple_compat.h:19,
                 from libgowhatsapp.c:40:
/usr/include/libpurple/media.h:214:3: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
  214 |   guint num_params, GParameter *params);
      |   ^~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/libpurple/account.h:31,
                 from /usr/include/libpurple/purple.h:48,
                 from purple_compat.h:19,
                 from libgowhatsapp.c:40:
/usr/include/glib-2.0/gobject/gparam.h:271:8: note: declared here
  271 | struct _GParameter /* auxiliary structure for _setv() variants */
      |        ^~~~~~~~~~~

Pidgin plugin not loaded

Hi
I can't create an account
when starting pidgin i have an error

(01:05:10) plugins: probing /home/xxx/.purple/plugins/libgowhatsapp.so
(01:05:10) plugins: /home/xxx/.purple/plugins/libgowhatsapp.so is not loadable: undefined symbol: unsafe.Pointer..d

Pidgin version: pidgin-2.13

Can you send me libgowhatsup.so ??

Compilation errors

Hi,

I'm trying to compile binary on Windows x64 and i'm receiving such errors:

`d:\www\purple-gowhatsapp-master>go build -buildmode=c-archive -o purplegwa.a pur
plegwa.go
# command-line-arguments
.\purplegwa.go:129:17: handler.sendMediaMessage undefined (type *waHandler has n
o field or method sendMediaMessage)
.\purplegwa.go:230:9: handler.downloadMessage undefined (type *waHandler has no
field or method downloadMessage)
.\purplegwa.go:235:9: handler.downloadMessage undefined (type *waHandler has no
field or method downloadMessage)
.\purplegwa.go:239:9: handler.downloadMessage undefined (type *waHandler has no
field or method downloadMessage)
.\purplegwa.go:243:9: handler.downloadMessage undefined (type *waHandler has no
field or method downloadMessage)
.\purplegwa.go:340:17: undefined: generateFilepath
.\purplegwa.go:341:12: handler.storeDownloadedData undefined (type *waHandler ha
s no field or method storeDownloadedData)`

What would be a problem?

Mark new messages as read only when the conversation window has been displayed

When a message is received, the notification on phone is not displayed because the message is marked as read, even if the concerned conversation window has not been displayed.
If we are nearer the phone, we cannot reply to the message directly using the notification icon.

Would it be possible to mark messages as read only when the conversation window has been displayed instead of marking it as read directly?

Tutorial for Build by myself?

Can u write a little introduction to build manually this plugin?
It doesn work for me on Ubuntu 18.04, every other purple-plugin works.

Compilation problem

Hello,

I'm trying to compile the plugin under Fedora 30 but resulting library doesn't load into Pidgin. I tried the binary from [REDACTED BY @hoehermann] but it throws an error at login:

error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}

I also noticed the compiled file is smaller (5.8mb) compared to the downloaded binary (8.1mb), so it apparently doesn't compile correctly, but I don't get any errors either. (the specific commit cc103e6 pointed in readme file is unavailable).

New lines are being sent as new messages

Every new line is being separated as a new message, although it should be in one message.
I hope this is something easy to fix.
And is there any chance to use it while the phone is offline?

only 1 connection at a time?

I read that this plugin only allows one connection to whatsapp at a time, including the connection from your phone.

Is that a whatsapp limitation or just this plugin? I.e. could I connect to whatsapp from two phones successfully or will that also limit me to only one connection? Does it refuse the second one or does the second connection boot the first one?

"qr code scan timed out" error, but no QR code shown

Using Pidgin 2.13.0 on Ubuntu 18.04, I installed the latest (2020-01-01) build of the plugin in ~/.purple/plugins. When I restart Pidgin, I am able to create an account. (I notice that the account has no icon, is that normal?) The bottom of my Buddy List then shows "Connecting" and after a while it gives the error "error during login: qr code scan timed out". But no QR code ever popped up. I had a look in the window list (I am using GNOME), and could see no window there (so it had not for example popped up under other windows).

I can't find anything about this in the closed issues or the Wiki page (BTW, the link from README to "Common problems" seems to be broken).

Finch not displaying qrcode

Problem

Dear all,

Finch is failing to display the QR code necessary to logon as can be shown in the image below:

2020-06-01-133858_792x424_scrot

Warnings

I'm not fully sure about the origin of the problem, though the building of purple-gowhatsapp did display some warnings. The output of $sudo make clean install was:

> rm -f libgowhatsapp.so purplegwa.a gwa-to-purple.o
> cc -O2 -g -ggdb -pipe -Wall -std=c99 -DGOWHATSAPP_PLUGIN_VERSION='"0.2.0~gite1bdd1f"' -DMARKDOWN_PIDGIN -DLOCALEDIR=\"/usr/share/locale\" -c -o gwa-to-purple.o gwa-to-purple.c
> go get github.com/skip2/go-qrcode
> go get github.com/gabriel-vasile/mimetype
> go build -buildmode=c-archive -o purplegwa.a purplegwa.go purplegwa-media.go
> cc -O2 -g -ggdb -pipe -Wall -std=c99 -DGOWHATSAPP_PLUGIN_VERSION='"0.2.0~gite1bdd1f"' -DMARKDOWN_PIDGIN -DLOCALEDIR=\"/usr/share/locale\" -fPIC -shared -o libgowhatsapp.so libgowhatsapp.c purplegwa.a purple2compat/http.c purple2compat/purple-socket.c -Wl,-z,relro `pkg-config purple glib-2.0 --libs --cflags`  -Ipurple2compat
> In file included from /usr/include/libpurple/media/codec.h:35,
>                  from /usr/include/libpurple/media.h:31,
>                  from /usr/include/libpurple/prpl.h:75,
>                  from /usr/include/libpurple/buddyicon.h:39,
>                  from /usr/include/libpurple/blist.h:110,
>                  from /usr/include/libpurple/status.h:133,
>                  from /usr/include/libpurple/connection.h:151,
>                  from /usr/include/libpurple/account.h:49,
>                  from /usr/include/libpurple/purple.h:48,
>                  from purple_compat.h:19,
>                  from libgowhatsapp.c:41:
> /usr/include/libpurple/media/../util.h:1397:13: warning: Deprecated pre-processor symbol, replace with 
>  1397 | G_CONST_RETURN gchar *purple_gai_strerror(gint errnum);
>       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
> In file included from /usr/include/libpurple/prpl.h:75,
>                  from /usr/include/libpurple/buddyicon.h:39,
>                  from /usr/include/libpurple/blist.h:110,
>                  from /usr/include/libpurple/status.h:133,
>                  from /usr/include/libpurple/connection.h:151,
>                  from /usr/include/libpurple/account.h:49,
>                  from /usr/include/libpurple/purple.h:48,
>                  from purple_compat.h:19,
>                  from libgowhatsapp.c:41:
> /usr/include/libpurple/media.h:165:3: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
>   165 |   guint num_params, GParameter *params);
>       |   ^~~~~
> In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
>                  from /usr/include/glib-2.0/gobject/gbinding.h:29,
>                  from /usr/include/glib-2.0/glib-object.h:22,
>                  from /usr/include/libpurple/account.h:31,
>                  from /usr/include/libpurple/purple.h:48,
>                  from purple_compat.h:19,
>                  from libgowhatsapp.c:41:
> /usr/include/glib-2.0/gobject/gparam.h:271:8: note: declared here
>   271 | struct _GParameter /* auxiliary structure for _setv() variants */
>       |        ^~~~~~~~~~~
> In file included from /usr/include/libpurple/prpl.h:75,
>                  from /usr/include/libpurple/buddyicon.h:39,
>                  from /usr/include/libpurple/blist.h:110,
>                  from /usr/include/libpurple/status.h:133,
>                  from /usr/include/libpurple/connection.h:151,
>                  from /usr/include/libpurple/account.h:49,
>                  from /usr/include/libpurple/purple.h:48,
>                  from purple_compat.h:19,
>                  from libgowhatsapp.c:41:
> /usr/include/libpurple/media.h:214:3: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
>   214 |   guint num_params, GParameter *params);
>       |   ^~~~~
> In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
>                  from /usr/include/glib-2.0/gobject/gbinding.h:29,
>                  from /usr/include/glib-2.0/glib-object.h:22,
>                  from /usr/include/libpurple/account.h:31,
>                  from /usr/include/libpurple/purple.h:48,
>                  from purple_compat.h:19,
>                  from libgowhatsapp.c:41:
> /usr/include/glib-2.0/gobject/gparam.h:271:8: note: declared here
>   271 | struct _GParameter /* auxiliary structure for _setv() variants */
>       |        ^~~~~~~~~~~
> In file included from /usr/include/libpurple/media/codec.h:35,
>                  from /usr/include/libpurple/media.h:31,
>                  from /usr/include/libpurple/blist.h:111,
>                  from /usr/include/libpurple/buddyicon.h:37,
>                  from /usr/include/libpurple/conversation.h:151,
>                  from /usr/include/libpurple/log.h:53,
>                  from /usr/include/libpurple/account.h:50,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/http.h:33,
>                  from purple2compat/http.c:22:
> /usr/include/libpurple/media/../util.h:1397:13: warning: Deprecated pre-processor symbol, replace with 
>  1397 | G_CONST_RETURN gchar *purple_gai_strerror(gint errnum);
>       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
> In file included from /usr/include/libpurple/blist.h:111,
>                  from /usr/include/libpurple/buddyicon.h:37,
>                  from /usr/include/libpurple/conversation.h:151,
>                  from /usr/include/libpurple/log.h:53,
>                  from /usr/include/libpurple/account.h:50,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/http.h:33,
>                  from purple2compat/http.c:22:
> /usr/include/libpurple/media.h:165:3: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
>   165 |   guint num_params, GParameter *params);
>       |   ^~~~~
> In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
>                  from /usr/include/glib-2.0/gobject/gbinding.h:29,
>                  from /usr/include/glib-2.0/glib-object.h:22,
>                  from /usr/include/libpurple/account.h:31,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/http.h:33,
>                  from purple2compat/http.c:22:
> /usr/include/glib-2.0/gobject/gparam.h:271:8: note: declared here
>   271 | struct _GParameter /* auxiliary structure for _setv() variants */
>       |        ^~~~~~~~~~~
> In file included from /usr/include/libpurple/blist.h:111,
>                  from /usr/include/libpurple/buddyicon.h:37,
>                  from /usr/include/libpurple/conversation.h:151,
>                  from /usr/include/libpurple/log.h:53,
>                  from /usr/include/libpurple/account.h:50,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/http.h:33,
>                  from purple2compat/http.c:22:
> /usr/include/libpurple/media.h:214:3: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
>   214 |   guint num_params, GParameter *params);
>       |   ^~~~~
> In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
>                  from /usr/include/glib-2.0/gobject/gbinding.h:29,
>                  from /usr/include/glib-2.0/glib-object.h:22,
>                  from /usr/include/libpurple/account.h:31,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/http.h:33,
>                  from purple2compat/http.c:22:
> /usr/include/glib-2.0/gobject/gparam.h:271:8: note: declared here
>   271 | struct _GParameter /* auxiliary structure for _setv() variants */
>       |        ^~~~~~~~~~~
> In file included from /usr/include/libpurple/media/codec.h:35,
>                  from /usr/include/libpurple/media.h:31,
>                  from /usr/include/libpurple/blist.h:111,
>                  from /usr/include/libpurple/buddyicon.h:37,
>                  from /usr/include/libpurple/conversation.h:151,
>                  from /usr/include/libpurple/log.h:53,
>                  from /usr/include/libpurple/account.h:50,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/purple-socket.h:31,
>                  from purple2compat/purple-socket.c:22:
> /usr/include/libpurple/media/../util.h:1397:13: warning: Deprecated pre-processor symbol, replace with 
>  1397 | G_CONST_RETURN gchar *purple_gai_strerror(gint errnum);
>       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
> In file included from /usr/include/libpurple/blist.h:111,
>                  from /usr/include/libpurple/buddyicon.h:37,
>                  from /usr/include/libpurple/conversation.h:151,
>                  from /usr/include/libpurple/log.h:53,
>                  from /usr/include/libpurple/account.h:50,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/purple-socket.h:31,
>                  from purple2compat/purple-socket.c:22:
> /usr/include/libpurple/media.h:165:3: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
>   165 |   guint num_params, GParameter *params);
>       |   ^~~~~
> In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
>                  from /usr/include/glib-2.0/gobject/gbinding.h:29,
>                  from /usr/include/glib-2.0/glib-object.h:22,
>                  from /usr/include/libpurple/account.h:31,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/purple-socket.h:31,
>                  from purple2compat/purple-socket.c:22:
> /usr/include/glib-2.0/gobject/gparam.h:271:8: note: declared here
>   271 | struct _GParameter /* auxiliary structure for _setv() variants */
>       |        ^~~~~~~~~~~
> In file included from /usr/include/libpurple/blist.h:111,
>                  from /usr/include/libpurple/buddyicon.h:37,
>                  from /usr/include/libpurple/conversation.h:151,
>                  from /usr/include/libpurple/log.h:53,
>                  from /usr/include/libpurple/account.h:50,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/purple-socket.h:31,
>                  from purple2compat/purple-socket.c:22:
> /usr/include/libpurple/media.h:214:3: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
>   214 |   guint num_params, GParameter *params);
>       |   ^~~~~
> In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
>                  from /usr/include/glib-2.0/gobject/gbinding.h:29,
>                  from /usr/include/glib-2.0/glib-object.h:22,
>                  from /usr/include/libpurple/account.h:31,
>                  from /usr/include/libpurple/connection.h:149,
>                  from purple2compat/purple-socket.h:31,
>                  from purple2compat/purple-socket.c:22:
> /usr/include/glib-2.0/gobject/gparam.h:271:8: note: declared here
>   271 | struct _GParameter /* auxiliary structure for _setv() variants */
>       |        ^~~~~~~~~~~
> mkdir -m 0755 -p `pkg-config --variable=datadir purple`/pixmaps/pidgin/protocols/16
> mkdir -m 0755 -p `pkg-config --variable=datadir purple`/pixmaps/pidgin/protocols/22
> mkdir -m 0755 -p `pkg-config --variable=datadir purple`/pixmaps/pidgin/protocols/48
> install -m 0644 -p icons/16/whatsapp.png `pkg-config --variable=datadir purple`/pixmaps/pidgin/protocols/16/whatsapp.png
> install -m 0644 -p icons/22/whatsapp.png `pkg-config --variable=datadir purple`/pixmaps/pidgin/protocols/22/whatsapp.png
> install -m 0644 -p icons/48/whatsapp.png `pkg-config --variable=datadir purple`/pixmaps/pidgin/protocols/48/whatsapp.png
> mkdir -m 0755 -p `pkg-config --variable=plugindir purple`
> install -m 0755 -p libgowhatsapp.so `pkg-config --variable=plugindir purple`

Setup

  • Finch: v2.13.0 (f07927902113041d6fa291293d9205ea4f05e9e6)
  • Terminal: st 0.8.3
  • OS: Arch Linux x86_64
  • Kernel: 5.6.14-arch1-1

Compilation error on Windows

Hi,

I'm trying to compile plugin on Windows using Makefile.mingw, but I stuck with errors:

cgo-gcc-export-header-prolog:25:14: error: size of array '_check_for_64_bit_poin
ter_matching_GoInt' is negative
libgowhatsapp.c:44:2: error: #error Must set GOWHATSAPP_PLUGIN_VERSION in Makefi
le
libgowhatsapp.c: In function 'gowhatsapp_message_newer_than_last_session':
libgowhatsapp.c:139:12: error: comparison between signed and unsigned integer ex
pressions [-Werror=sign-compare]
libgowhatsapp.c: At top level:
libgowhatsapp.c:586:5: error: 'GOWHATSAPP_PLUGIN_VERSION' undeclared here (not i
n a function)
cc1.exe: all warnings being treated as errors
Makefile.mingw:53: recipe for target 'libgowhatsapp.dll' failed
mingw32-make: *** [libgowhatsapp.dll] Error 1

I don't see any place to declare 'GOWHATSAPP_PLUGIN_VERSION' in Makefile.

make GOPATH as local as possible

mqs says:

Could you make GOPATH as local as possible, e.g. $srcdir/gopath to simplify cleaning up afterwards? This is also recommended in the go packaging guidelines for archlinux, the Makefile of purple-gowhatsapp does not do this. I tried it and it is sufficient to replace make with GOPATH="$srcdir/gopath" make in the build function (maybe you have to create that folder in prepare beforehand).

[FEATURE REQUEST] website card?

Hello! Thank you for your work! It works for me.

When I send a link vía WhatsappWeb or the Android app it has a websitecard previsualization, but when I post it from pidgin it does not make the preview. Have you thought to create this feature in the future??

Thank you very much

Order of pervious message is as received and not by timestamp

As one can easily see the order is not in order (pun intended):

(2020-05-02 14:53:31) XXX: läser mkt samtidigt, så jag vet vad ska jag skriva
(2020-05-02 16:17:48) XXX: Fan vad jag vill röka
(2020-05-02 14:53:13) Markus: Tur att du har hela helgen på dig
(2020-05-02 14:53:36) Markus: Mmm

Old messages notified many times

Is there a good reason why this plugin is using ids to identify messages already received? The list of ids, as it is stored right now, is cumbersome, and is truncated quickly. As a result, when this plugin disconnects from whatsapp and the reconnects, it happens often that old messages are shown again, as new.

I think that keeping a timestamp of the most recent received message, and accepting new messages only if newer than the timestamp, is way lighter and safer. There might be the chance of missing messages (but I'm not sure, and I guess the event is extremely rare), but I think it would still be better than the current approach.

failed to login

Suddenly it stops! I tried to re-login, it doesn't work. I'm using the windows build from @EionRobb . Other protocols work fine.

error during login: login connection timed out

(08:51:30) gowhatsapp: 3773XXX recieved message type -1 at 0 id (null) remote (null) sender (null) (fromMe 0, system 0): error during login: login connection timed out
(08:51:30) connection: Connection error on 3773XXX (reason: 16 description: error during login: login connection timed out)
(08:51:30) jabber: jabber_actions: have pep: NO
(08:51:30) gowhatsapp: 3773XXX recieved message type -1 at 0 id (null) remote (null) sender (null) (fromMe 0, system 0): keepAlive failed: connection timed out
(08:51:30) gowhatsapp: 3773XXX recieved message type -1 at 0 id (null) remote (null) sender (null) (fromMe 0, system 0): server closed connection,code: 1000,text: 
(08:51:30) account: Disconnecting account XXX (XXX)
(08:51:30) connection: Disconnecting connection 3773XXX
(08:51:30) jabber: jabber_actions: have pep: NO
(08:51:30) connection: Destroying connection 3773XXX

Suddenly stopped login

error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}

I tried reset/relogin. It doesn't work anymore.

text rendering for QR code (to support text only clients)

I spent some time trying to whack the pidgin config generated by pidgin into bitlbee-pidgin, but failed.
My problem is, that I get presented with this during login:

12:45:58 < login> dm8tbr: Scan this QR code within 20 seconds to log in.<img id="1">
12:46:18 <@root> hehoe-gowhatsapp - Login error: error during login: qr code scan timed out
12:46:18 <@root> hehoe-gowhatsapp - Logging in: Signing off..

I looked around but didn't see an option to dump the image reference to a file or something like that within bitlbee-purple, to possibly work around.

I'd give it a try myself, but I'm not familiar with go at all.
Any chance you could integrate something like https://github.com/fumiyas/qrc or https://github.com/mdp/qrterminal -- both of which seem to be go libraries for rendering QR codes to text / terminals.

Unable to send message: sending message timed out

I've been testing the plugin for 2 days and the issue that hits me is that for almost every message I send, I get the following error in the conversation window:

(19:30:45) Unable to send message.
(19:30:45) Unable to send message: sending message timed out

The message is actually received and I can see it on my Android device. I checked the log but it only says:

(19:30:45) gowhatsapp: Recieved: at 0 id  remote [email protected] sender (fromMe 0)

I searched for the issue but only found this thread: Rhymen/go-whatsapp#38 which suggests refactoring the code.

Is there a possible way to fix this issue? (I have no problems with receiving the messages from the Android device, including the ones marked as unsent in conversation window).

Pidgin 2.13.0-9.fc30 (libpurple 2.13.0)
f07927902113041d6fa291293d9205ea4f05e9e6

[FEATURE REQUEST] Send audio

Hello, how are you? Thank you very much for your work. I would like to send audio, it would be possible? Thanks in advance

Regards

Support for stickers

Thank you for the latest build, I was trying the latest build with inline images. It works fine, though there are some improvements which will be helpful!

i. incoming inline-image works fine but when I send an image(outgoing) from Whatsapp Smartphone App, it doesn't show the image as inline view, rather this error.

A media message (ID 8492...) was received, but the download failed: no url present

ii. For incoming stickers, it shows this text with broken image icon. It could show the actual image of the sticker as an inline view.

Contact sent a sticker: [Image]

iii. If I send a sticker from Whatsapp Smartphone App, it shows this error.

A media message (ID C97...) was received, but the download failed: no url present
Name: Contact sent a sticker:

iv. I use a plugin to show notification of chats. it works great for incoming message. But when I send a message from Whatsapp Smartphone App, it shows notification for my own(outgoing) message! For purple-facebook or other protocols, it doesn't show any notification for an outgoing message.

Improve compatibility with spectrum2

trying to get this plugin to work with spectrum2 libpurple backend

  1. I was able to compile it
  2. spectrum2 able to talk to this plugin.
  3. on attempt to add account I only getting following message in chat window and in logs :
    "error during login: qr code scan timed out"

P.S> maybe I'm doing something wrong.
thanks

piece from log :

8904: 2019-03-27 14:27:22,490 INFO  libpurple: account:Connecting to account [email protected].
8904: 2019-03-27 14:27:22,490 INFO  libpurple: connection:Connecting. gc = 0x23eb0c0
8904: 2019-03-27 14:27:23,751 INFO  libpurple: gowhatsapp:Recieved: at 0 id  remote [email protected] sender  (fromMe 0)
8904: 2019-03-27 14:27:23,752 INFO  backend: conv_write_im()
8904: 2019-03-27 14:27:23,752 INFO  backend: conv_write_im(): ignoring a system message
...
8953: 2019-03-27 14:28:25,752 INFO  libpurple: gowhatsapp:Recieved: at 0 id (null) remote (null) sender (null) (fromMe 0)
8953: 2019-03-27 14:28:25,752 INFO  libpurple: connection:Connection error on 0x181f0c0 (reason: 0 description: error during login: qr code scan timed out

thanks

Failure to build on 32bit/Windows

C:/Go/bin/go build -buildmode=c-archive -o purplegwa.a purplegwa.go
# command-line-arguments
.\purplegwa.go:140:5: cannot use _Ctype_uint(len(message.data)) (type _Ctype_uint) as type _Ctype_ulonglong in field value
make: *** [Makefile.mingw:49: purplegwa.a] Error 2

I don't know anything about go, but to get it to compile I replaced it with

blobsize  : C.ulonglong(len(message.data)),

and that seems to work

Can't connect using HTTP/Socks5 proxy

Is there any way to connect whatsapp through socks5 or http proxy similar to Hangouts or Skype in Pidgin.

While trying the similar way, I was getting this error:
couldn't dial whatsapp web websocket: dial tcp 31.13.72.34:443: i/o timeout

Cannot compile in 32bit-Ubuntu

I want to compile purple-gowhatsapp, but I have many errors like this:

purplegwa.a(000000.o):(.data.rel.local+0x4): multiple definition of `GOWHATSAPP_FAKE_ONLINE_OPTION'
/tmp/ccxNumtC.o:(.data.rel.local+0x9c): first defined here

purplegwa.a(000000.o): In function `gowhatsapp_go_sendMessage':
/tmp/go-build/command-line-arguments/_obj/_cgo_export.c:27: multiple definition of `GOWHATSAPP_SESSION_CLIENDID_KEY'
/tmp/ccxNumtC.o:/home/dirk/purple-gowhatsapp/libgowhatsapp.c:290: first defined here

/tmp/go-build/command-line-arguments/_obj/_cgo_export.c:26: multiple definition of `GOWHATSAPP_DOWNLOAD_TRY_ONLY_ONCE_OPTION'
/tmp/ccxNumtC.o:/home/dirk/purple-gowhatsapp/libgowhatsapp.c:287: first defined here

purplegwa.a(000000.o): In function `gowhatsapp_go_sendMessage':
/tmp/go-build/command-line-arguments/_obj/_cgo_export.c:18: multiple definition of `GOWHATSAPP_RESTORE_SESSION_OPTION'
/tmp/ccxNumtC.o:/home/dirk/purple-gowhatsapp/libgowhatsapp.c:292: first defined here

collect2: error: ld returned 1 exit status
Makefile:55: die Regel für Ziel „libgowhatsapp.so“ scheiterte
make: *** [libgowhatsapp.so] Fehler 1

The lines with "first defined here" are many more...

Regards, Dirk

Incompatibility with Conversation Colors plug-in

Just did build form master.zip and added my existing WhatsApp account. I got this message "Scan this QR code within 20 seconds to log in." but no picture was displayed. What could be wrong? Do I need some Pidgin plugin enabled/installed?

Regards,
Piotr

Debian 10: error during login

I builded go-whatsapp from sources and when I connect with my account I received the following error: "error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {}"
Same error using the prebuilt library which I found in https://buildbot.hehoe.de/purple-gowhatsapp/builds/current
I'm using Debian 10 LXDE 64bit, go version go1.13 linux/amd64, pidgin version 2.13.0

Installation Wiki

Hi,
Thanks for your work. i would like to test is, but can't find a installation manual.
(UbuntuMate 18.04)

Crashing on Arch

It crashes as soon as I read the QRCode.

  1. Using pidgin from official repository
  2. Using purple-gowhatsapp from aur
  3. Uname: 5.7.5-arch1-1
  4. When removing logging and running pidgin -d, I'm able to confirm the following error on whatsapp account:
(13:27:06) g_log: purple_conversation_get_im_data: assertion 'conv != NULL' failed
  1. Stacktrace using the following guide from pidgin
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pidgin...
(No debugging symbols found in pidgin)
(gdb) handle SIGPIPE nostop noprint
Signal        Stop	Print	Pass to program	Description
SIGPIPE       No	No	Yes		Broken pipe
(gdb) run
Starting program: /usr/bin/pidgin 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffecb52700 (LWP 89381)]
[New Thread 0x7fffc15ee700 (LWP 89382)]
[New Thread 0x7fffc0ded700 (LWP 89383)]
[New Thread 0x7fffbbfff700 (LWP 89384)]
[New Thread 0x7fffbb7fe700 (LWP 89385)]
[New Thread 0x7fffbaf66700 (LWP 89386)]
[New Thread 0x7fffba765700 (LWP 89387)]
[New Thread 0x7fffb938e700 (LWP 89397)]
[New Thread 0x7fffb8b8d700 (LWP 89398)]
[New Thread 0x7fff8f46a700 (LWP 89399)]
[Detaching after fork from child process 89400]
[Detaching after fork from child process 89401]
[Detaching after fork from child process 89402]
[Detaching after fork from child process 89403]
[New Thread 0x7fff8ea89700 (LWP 89404)]
[New Thread 0x7fff8e288700 (LWP 89405)]
[New Thread 0x7fff8da47700 (LWP 89406)]
[New Thread 0x7fff8d206700 (LWP 89407)]
[New Thread 0x7fff8ca05700 (LWP 89408)]
[New Thread 0x7fff73fff700 (LWP 89409)]
[New Thread 0x7fff7133c700 (LWP 89455)]
[New Thread 0x7fff70b3b700 (LWP 89456)]
[New Thread 0x7fff5c393700 (LWP 89457)]
[Thread 0x7fff5c393700 (LWP 89457) exited]
[New Thread 0x7fff5c393700 (LWP 89458)]
[New Thread 0x7fff5bb92700 (LWP 89459)]
[New Thread 0x7fff5b371700 (LWP 89460)]
[Thread 0x7fff5c393700 (LWP 89458) exited]
[Thread 0x7fff5bb92700 (LWP 89459) exited]
[Thread 0x7fff70b3b700 (LWP 89456) exited]
[Thread 0x7fff7133c700 (LWP 89455) exited]
[New Thread 0x7fff70b3b700 (LWP 89584)]
[New Thread 0x7fff7133c700 (LWP 89585)]
[New Thread 0x7fff5bb92700 (LWP 89586)]

Thread 1 "pidgin" received signal SIGSEGV, Segmentation fault.
0x00007ffff70f8a0a in purple_conversation_write () from /usr/lib/libpurple.so.0
(gdb) bt full
#0  0x00007ffff70f8a0a in purple_conversation_write () at /usr/lib/libpurple.so.0
#1  0x00007fffecdaae7f in gowhatsapp_display_message () at /usr/lib/purple-2/libgowhatsapp.so
#2  0x00007fffecdaaffc in gowhatsapp_process_message () at /usr/lib/purple-2/libgowhatsapp.so
#3  0x00007fffecdab53a in gowhatsapp_process_message_bridge_mainthread () at /usr/lib/purple-2/libgowhatsapp.so
#4  0x00007ffff7238764 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7238340 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#6  0x00007ffff7285fa9 in  () at /usr/lib/libglib-2.0.so.0
#7  0x00007ffff7236c03 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#8  0x00007ffff78ceb7e in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0
#9  0x000055555558a988 in main ()
(gdb) quit
A debugging session is active.

	Inferior 1 [process 89377] will be killed.

Quit anyway? (y or n) y

pidgin

Not able to build on Ubuntu 18.04

Trying to build on Ubuntu 18.04:

make
go get github.com/Rhymen/go-whatsapp
cc -O2 -g -ggdb -pipe -Wall -std=c99 -DGOWHATSAPP_PLUGIN_VERSION='"0.1.0~gitca7f536"' -DMARKDOWN_PIDGIN -DLOCALEDIR=\"/usr/share/locale\" -c -o gwa-to-purple.o gwa-to-purple.c
go get github.com/skip2/go-qrcode
go build -buildmode=c-archive -o purplegwa.a purplegwa.go purplegwa-media.go
purplegwa-media.go:28:2: cannot find package "github.com/gabriel-vasile/mimetype" in any of:
        /usr/lib/go-1.10/src/github.com/gabriel-vasile/mimetype (from $GOROOT)
        /tmp/temp/go/src/github.com/gabriel-vasile/mimetype (from $GOPATH)
Makefile:51: recipe for target 'purplegwa.a' failed
make: *** [purplegwa.a] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.