Update bulk with sync result #804#815
Open
mgp25 wants to merge 702 commits intovenomous0x:masterfrom
mgp25:patch-11
Open
Update bulk with sync result #804#815mgp25 wants to merge 702 commits intovenomous0x:masterfrom mgp25:patch-11
mgp25 wants to merge 702 commits intovenomous0x:masterfrom
mgp25:patch-11
Conversation
Makes your constant strings shorter and solves compatibility issues with older PHP versions.
69 huehuehue
One of the fixes for #467
Fix login: Use only version number for WHATSAPP_VER.
Added "OnProfilePictureChanged" Event. Will be fired if one of your contacts changes its profile picture.
Wrong copy past, missing {}.
Some numbers were not identificated as actual users
Changed User-Agent to a newer version
OnProfilePictureChanged Event
Added Event, that will be fired when the user calls: "sendGetGroupsParticipants".
I luv copy paste...
OnGetGroupParticipants Event
Should play nicer with proxies and firewalls
Should help with #485
No more "help I get response tx rx tx rx tx rx rx rx tx tx" No more inner rage for me :-)
Capturing this event can prevent you from talking to a closed connection like a retard
Replaced by new nodeString HTML formatter
Added target user to lastSeen event
Fixes #492
Also fixes #492
Add Send vCard In Broadcast Functionality
Adding Missing "name" Argument To Prevent "Warning: Missing argument 3 for WhatsAppEventListenerProxy::onSendPresence()"
Update WhatsAppEvent.php
Adding Missing "name" Argument To Prevent "Warning: Missing argument 3 for WhatsAppEventListenerProxy::onSendPresence()"
Update whatsprot.class.php
A fix for firePresence. When using the event and want the $type value, it only shows 'unavailable', now returns also 'available'.
firePresence return "unavailable"
Deprecated functions from older file was used. Now its working.
Updated bulk.php
Olala Fixes #777
sendSetProfilePicture supports an url as argument
Now it onMessageComposing and onMessagePaused works.
Fixed typo
FIX: PHP Notice: Use of undefined constant jpg - assumed 'jpg' in /home/abdul/project/whatsapp/WhatsAPI/src/php/whatsprot.class.php on line 2896
I have no idea where this contacts.php removed to
Fix for 'Use of undefined constant jpg'
Contributor
|
I see what you did there, but SendSync() is never called so the event handler won't be fired. Also that die(); will stop the program from executing after receiving the sync result and before sending the messages. |
Contributor
Author
|
True, ill check that later |
Contributor
|
Your best option would be to either put the $wa object in a static property to make it accessible from the event handler, and send the messages from inside the event handler protected static $wa;
protected static $message;
public static function event_onSyncResult($result)
{
foreach($result->existing as $number)
{
$wa->sendMessage(self::$number, self::$message);
}
}or to put the sync result contacts in a static property and set it from the event handler: protected static $numbers = null;
public static function event_onSyncResult($result)
{
self::$numbers = $result->existing;
}
//send sync
$wa->SendSync($numbers);
//wait for response
while(!is_array(self::$numbers) && $wa->pollMessage());
//send
foreach(self::$numbers as $number)
{
$wa->sendMessage($number, $message);
} |
Now bulk.php uses sendSync and only send messages to numbers that exists (have WhatsApp account).
Contributor
Author
|
Fixed |
Forget to remove a variable $i. Now everything is ok! :-)
d56e5ea to
e6cf5a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhancement #804