How do I implement Google "Off the Record" with Smack API - xmpp

I have a functioning XMPP chat client that is working with gtalk. I can not figure out how to implement some of the google custom extensions using the Smack API.
Specifically, I want to set the google talk user settings such that archivingenabled = false as described in the following link.
https://developers.google.com/talk/jep_extensions/usersettings
Additionally, if I decide to leave archivingenabled= true and try to control the google off the record setting individually I would need help monitoring and setting the google:nosave state as described in the following link:
https://developers.google.com/talk/jep_extensions/otr
My problem is that I can't figure out how to implement either of these things in code. The igniteRealtime documentation describes the approach in the following link:
www.igniterealtime.org/builds/smack/docs/latest/documentation/providers.html
(note: http:// was removed because I was over my limit on links)
I would appreciate any examples on how to code these 2 google talk extensions.
Thanks!
Matt

Start by creating a packet that extends IQ to send your requests. This can then be sent using SynchPacketSend(). Each individual command is an extension to be added to this IQ packet.
Then create a provider, as shown in the link you provided to convert the reply into your custom packet type.
You can look at the LeafNode.getItems() request as an example. Just follow the code and it will show you how to create and send the appropriate IQ packet. Check the providers package for how to receive replies.

Related

Need to send Whatsapp Messages from Salesforce - Apex Code

I am doing a proof of concept to find a way to make callouts from Apex code to send automated Whatsapp messages/communications from Salesforce to our customers at difference points of time in Sales life cycle (ex: one at lead conversion, one when a payment is received etc).
My assumption here is to send these messages via triggers. Only thing is i am not able to figure out the correct approach to start with. I did see an example online which is using middleware apps like twilio, weboxapp to convey the messages to Whatsapp servers. Is there a way these communications could be sent directly? Any leads are appreciated!
There appears to be a fairly new integration set up between Salesforce and WhatsApp. There's a good write up in the first link below, and then documentation from Salesforce in the 2nd link. I'd start by looking through there because it might help solve your requirements much more easily. I believe that Whatsapp's APIs are private and need to be accessed through an approved partner.
https://www.wearemarketing.com/blog/salesforce-whatsapp-integration-release.html
https://help.salesforce.com/articleView?id=sf.messaging_set_up_whatsapp.htm&type=5

How to implement Gmail Smart-Compose feature in my project using Gmail API?

I wanted to use the Gmail smart compose feature in my project. I read many documents but no documents suggest anything related to the implementation of smart compose in Gmail API.
Attaching a link below about the small information about the autocomplete feature:
SmartCompose
Answer:
Unfortunately, this is not possible to do using the Gmail API.
More information:
The Gmail API using the client libraries works on a request-response basis, and these are not retrievable through a Gmail API method. In order to do this, there would need to be a request made each time the string the user is typing changes, which would use not only require a lot of network traffic, but would also make application running slow as many requests would be made.
Feature Request:
On the flip side however, Google already knows about this, and a Feature Request for this has been made on their Issue Tracker. You can view this feature request here, to which you can click the star (☆) in the top left to let Google know more people want this feature to be implemented.
References:
Autocomplete suggestions for text-inputs
Google's Issue Tracker
An API for gmail smart-compose feature

In which format I should send http POST to Bot Builder?

I was trying to built a bot which interacts with multiple users.
The Microsoft Bot Builder seems nice to me.
I followed their examples and tried them out.
Bot Builder Restify and so on
There are few things which are not clear to me.
How can I post a message to bot rest endpoint?
The emulator seems to have been taking care of such details. But in a real application, in which format i should sent a message?
How does the bot interacts with multiple users? In the emulator, there is only one user, what happens if there are several persons talk to the bot at the same time in a real application?
I think "chatconnector" somehow doing the job, but I am not sure.
I hope someone could point out examples or give answers below to clarify these to me.
Thanks in advance!
1) Messages are sent using industry-standard REST and JSON over HTTPS. Although you can call the bot's endpoint directly, this would bypass channels and security. In the Microsoft Bot Framework architecture, clients communicate with a channel connector and the channel connector calls the bot. When the bot responds, it sends a message to the channel connector and the connector calls the client. The channel connectors transform messages from the channel's specific schema to the Bot Framework's generic activity schema and back. They also verify that callers are authorized using JWT tokens.
This documentation on Authentication might help clear things up some: https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-authentication
2) Group conversations are handled differently, depending on the channel. This sample demonstrates some of the group conversation features in the Bot Builder Node sdk: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/core-GetConversationMembers

How to integrate with OpenFire XMPP server to receive roster info for users?

I need to create small auxiliary server that is part/integrates with OpenFire server in order to get roster for a given user.
I was looking for some plugin/api call that given the user JID to return his contacts and their online status.
All-in-all I may end up changing OpenFire's code but I was hoping that there is a easier solution
All though the links provided by Manasi would work for you. However those links refers to user service plugin which has been depricated by openfire.
They recommend to use REST API plugin.
You'll see list of all plugins here.
You should read about retrieving user roster and their presence .
You could try using the user service plugin of openfire that returns a host of information of the user as well as its rosters.
for documentation click here.
You can get the roster information by this url.

Registration Process in XMPP Chat for iPhone

I am implementing a XMPP client for my iPhone App, I ahve completed all the things in (Chatting with other users , showing presence of other users , etc.)
But the one thing for which I am stuck is that , I am unable to get the new user registered from my App. I am using following snippet,
if ([appDelegate.xmppStream supportsInBandRegistration])
[appDelegate.xmppStream registerWithPassword:txt_Password.text error:nil];
But for this, supportsInBandRegistration method always returns NO and the registerWithPassword: method is never called.
Please provide some help regarding the same.
What server are you using? Some servers support in-band registration even thought they don't send the correct stream:feature according to XEP-0077. Most of them should give the feature in the disco results however.
In other words, try commenting out your if ([appDelegate.xmppStream supportsInBandRegistration]) and see if it works. If so, you'll need to complain either to your library developer or to your server developer or both.