This file contains 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
// Make request | |
public void doRequest(int type) | |
{ | |
switch(type) | |
{ | |
// Create session request | |
case REQUEST_SESSION: | |
{ | |
String time = new Long(new Date().getTime()).toString(); | |
String timestamp = time.substring(0, time.length()-3); |
This file contains 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
chat_manager.internal_state = chat_manager.ONLINE; | |
boolean changes = false; // test if there are changes | |
boolean onlyphone = false; | |
boolean isNew = true; | |
if (chat_manager.currentjid == null || | |
!jid.getText().equals(chat_manager.currentjid.getFullJid()) || | |
!group.getText().equals(chat_manager.currentjid.group) || (phone.getText() != null && | |
!phone.getText().equals(chat_manager.currentjid.phone))) { | |
if (chat_manager.currentjid != null && | |
jid.getText().equals(chat_manager.currentjid.getFullJid()) && |
This file contains 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
if (field == bOnline) { | |
if (chat_manager.internal_state != chat_manager.OFFLINE && | |
chat_manager.internal_state != chat_manager.WAIT_CONNECT && Datas.jid != null) { | |
Presence.changePresence(Presence.getPresence("online"), | |
Datas.jid.status_message); | |
Datas.jid.setPresence(Presence.getPresence("online"), | |
Datas.jid.status_message); | |
chat_manager.getGuiOnlineMenu(); | |
} | |
} else if (field == bAway) { |
This file contains 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
// Method sends and gets messages | |
public void run() { | |
try { | |
if (chat_manager.currentConversation.isMulti) { | |
vman.add(new SeparatorField()); | |
GroupChat chat = | |
(GroupChat)Datas.multichat.get(chat_manager.currentConversation.name); | |
vman.add(new LabelField("Room Members:")); | |
if (chat != null) { | |
for (int j = 0; j < chat.jids.size(); j++) { |
This file contains 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
public void LoginToChat(final String _jid, final String _password, final String _userid) | |
{ | |
UiApplication.getUiApplication().invokeLater(new Runnable() | |
{ | |
public void run() | |
{ | |
jidName = _jid; | |
String jid = ""; | |
String password = ""; | |
String server = SERVER; |
This file contains 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
try { | |
System.out.println("----- Successfully subsribed on Push notifications"); | |
// Push Notification ON = 0 | |
// Push Notification OFF = 1 | |
OptionStorage.getInstance().getOption("Push notifications").setCurrentValueIndex(0); | |
} catch (Exception ex) { | |
DebugStorage.getInstance().Log(0, "<PushQbAuth> ProcessAnswer REQUEST_PUSH_SUBSCRIBE | |
Exception ", ex); | |
} | |
break; |
This file contains 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
try { | |
System.out.println("----- Successfullly UNSUBSCRIBED FROM PUSH"); | |
// Push Notification ON = 0 | |
// Push Notification OFF = 1 | |
OptionStorage.getInstance().getOption("Push notifications").setCurrentValueIndex(1); | |
} catch (Exception ex) { | |
DebugStorage.getInstance().Log(0, "<UnsubscribeQbPush> ProcessAnswer | |
REQUEST_PUSH_UNSUBSCRIBE ", ex); | |
} | |
break; |
This file contains 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
LabelField pushressievedLabel = new LabelField("Message ressieved on:") { | |
public void paint(Graphics g) { | |
g.setColor(0xffffff); | |
super.paint(g); | |
} | |
}; | |
pushressievedLabel.setPadding(5, 5, 0, 5); | |
pushressievedLabel.setFont(pushressievedLabel.getFont().derive(Font.BOLD)); | |
add(pushressievedLabel); |
This file contains 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
try { | |
PushNotificationsStorage.getInstance().removePushNotification(pNO); | |
onClose(); | |
} catch (Exception ex) { | |
System.out.println("removePushNotification exception = " + ex); | |
} |
This file contains 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
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.security.SignatureException; | |
/** | |
* @author Igor Khomenko | |
* injoit.com | |
* | |
* This class defines common routines for generating |
OlderNewer