Index: bombus-plus/export/trunk/nbproject/project.properties
===================================================================
--- bombus-plus/export/trunk/nbproject/project.properties (revision 1363)
+++ bombus-plus/export/trunk/nbproject/project.properties (working copy)
@@ -1,9 +1,9 @@
-abilities=ZLIB=,LOCALE_DEBUG=,MIDP2,FILE_TRANSFER=,FILE_IO=,DISABLE_AUTOFOCUS=,PEP=,MOTOROLA_BACKLIGHT=,COLOR_THEMES=,SASL_XGOOGLETOKEN=
+abilities=FILE_TRANSFER=,_TRAFFIC=,ZLIB=,CAPTCHA=,LOCALE_DEBUG=,_XML_STREAM_DEBUG=,_GAMES=,_XML_CONSOLE=,PEP=,SASL_XGOOGLETOKEN=,PEP_TUNE=,FILE_IO=,ARCHIVE_ADVANCED=,COLOR_THEMES=,DEBUG=
build.classes.dir=${build.dir}/compiled
build.classes.excludes=**/*.java,**/*.form,**/*.class,**/.nbintdb,**/*.mvd
build.dir=build/${config.active}
build.root.dir=build
-configs.Release.abilities=MIDP2,USE_UTF8_READER,SASL=,TRANSLATED=,MEM_STAT,MOTOROLA_BACKLIGHT=,OUTSTREAM_FLUSH,SASL_XGOOGLETOKEN=
+configs.Release.abilities=SASL_XGOOGLETOKEN=,CLIPBOARD=,MOTOROLA_BACKLIGHT=,CAPTCHA=,_XML_STREAM_DEBUG=,MIDP2
configs.Release.deployment.copy.target=ftp/midp2.0
configs.Release.deployment.ftp.passive=false
configs.Release.deployment.ftp.password=
@@ -12,7 +12,7 @@
configs.Release.deployment.ftp.separator=/
configs.Release.deployment.ftp.server=
configs.Release.deployment.ftp.userid=
-configs.Release.deployment.jarurl=http://bombus-im.org/builds/beta/midp2.0/${dist.jar}
+configs.Release.deployment.jarurl=
configs.Release.deployment.method=Copy
configs.Release.deployment.override.jarurl=true
configs.Release.deployment.scp.keyfile=${file.reference.JAVA-Bombus}
@@ -28,20 +28,89 @@
configs.Release.deployment.webdav.remotedir=
configs.Release.deployment.webdav.server=
configs.Release.deployment.webdav.userid=
-configs.Release.filter.exclude.tests=false
-configs.Release.filter.excludes=archive/DebugDumpArchive.java,io/file,io/file/**,ui/ScreenManager.java,Messages/MessageView.java,com/alsutton/jabber/datablocks/IqGetVCard.java,com/jcraft,com/jcraft/**
-configs.Release.filter.use.standard=true
configs.Release.javac.debug=false
configs.Release.javac.deprecation=true
configs.Release.javac.encoding=Cp1251
configs.Release.javac.optimize=true
-configs.Release.libs.classpath=resources/text;resources/MIDP2
+configs.Release.libs.classpath=resources/text;resources/MIDP2;resources/pep;resources/icon
configs.Release.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n
configs.Release.manifest.manifest=
-configs.Release.manifest.others=MIDlet-Vendor: Evgs\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\nMIDlet-Name: Bombus\n
+configs.Release.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n
configs.Release.obfuscation.custom=
configs.Release.obfuscation.level=9
-configs.ReleaseJZLIB.abilities=MIDP2,ZLIB=,FILE_IO=,FILE_TRANSFER=,PEP=,SIEMENS_BACKLIGHT=,MOTOROLA_BACKLIGHT=,COLOR_THEMES=,SASL_XGOOGLETOKEN=
+configs.ReleaseZVOFFK.abilities=_MAX_COMPRESSION=,_HTTPCONNECT=,FILE_TRANSFER=,_TRAFFIC=,ZLIB=,MOTOROLA_BACKLIGHT=,_XML_STREAM_DEBUG=,_CLIPBOARD=,_GAMES=,_CAPTCHA=,PEP=,CHANGE_TRANSPORT=,_NONSASL_ENABLE=,PEP_TUNE=,FILE_IO=,ARCHIVE_ADVANCED=,XML_CONSOLE=,COLOR_THEMES=,_LOCALE_DEBUG=,_DEBUG=
+configs.ReleaseZVOFFK.deployment.copy.target=${file.reference.midp2.0z}
+configs.ReleaseZVOFFK.deployment.ftp.passive=false
+configs.ReleaseZVOFFK.deployment.ftp.password=
+configs.ReleaseZVOFFK.deployment.ftp.port=21
+configs.ReleaseZVOFFK.deployment.ftp.remotedir=
+configs.ReleaseZVOFFK.deployment.ftp.separator=/
+configs.ReleaseZVOFFK.deployment.ftp.server=
+configs.ReleaseZVOFFK.deployment.ftp.userid=
+configs.ReleaseZVOFFK.deployment.jarurl=
+configs.ReleaseZVOFFK.deployment.method=Copy
+configs.ReleaseZVOFFK.deployment.override.jarurl=true
+configs.ReleaseZVOFFK.deployment.scp.keyfile=${file.reference.svn-trunk}
+configs.ReleaseZVOFFK.deployment.scp.passphrase=
+configs.ReleaseZVOFFK.deployment.scp.password=
+configs.ReleaseZVOFFK.deployment.scp.port=22
+configs.ReleaseZVOFFK.deployment.scp.remotedir=
+configs.ReleaseZVOFFK.deployment.scp.server=
+configs.ReleaseZVOFFK.deployment.scp.usekeyfile=no
+configs.ReleaseZVOFFK.deployment.scp.userid=
+configs.ReleaseZVOFFK.deployment.webdav.password=
+configs.ReleaseZVOFFK.deployment.webdav.port=80
+configs.ReleaseZVOFFK.deployment.webdav.remotedir=
+configs.ReleaseZVOFFK.deployment.webdav.server=
+configs.ReleaseZVOFFK.deployment.webdav.userid=
+configs.ReleaseZVOFFK.javac.debug=false
+configs.ReleaseZVOFFK.javac.deprecation=true
+configs.ReleaseZVOFFK.javac.encoding=Cp1251
+configs.ReleaseZVOFFK.javac.optimize=true
+configs.ReleaseZVOFFK.libs.classpath=resources/zlib;resources/text;resources/MIDP2_ReleaseZVOFFK;resources/themes_ReleaseZVOFFK;resources/pep;resources/icon_ReleaseZVOFFK
+configs.ReleaseZVOFFK.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n
+configs.ReleaseZVOFFK.manifest.manifest=
+configs.ReleaseZVOFFK.manifest.midlets=MIDlet-1: Bombus+,/_icon.png,midlet.Bombus\n
+configs.ReleaseZVOFFK.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n
+configs.ReleaseZVOFFK.obfuscation.custom=
+configs.ReleaseZVOFFK.obfuscation.level=9
+configs.ReleaseZLITE.abilities=SASL_XGOOGLETOKEN=,MOTOROLA_BACKLIGHT=,MIDP2
+configs.ReleaseZLITE.debug.level=debug
+configs.ReleaseZLITE.deployment.copy.target=${file.reference.midp2.0}
+configs.ReleaseZLITE.deployment.ftp.passive=false
+configs.ReleaseZLITE.deployment.ftp.password=
+configs.ReleaseZLITE.deployment.ftp.port=21
+configs.ReleaseZLITE.deployment.ftp.remotedir=
+configs.ReleaseZLITE.deployment.ftp.separator=/
+configs.ReleaseZLITE.deployment.ftp.server=
+configs.ReleaseZLITE.deployment.ftp.userid=
+configs.ReleaseZLITE.deployment.jarurl=
+configs.ReleaseZLITE.deployment.method=Copy
+configs.ReleaseZLITE.deployment.override.jarurl=true
+configs.ReleaseZLITE.deployment.scp.keyfile=${file.reference.bombus-bombus-plus}
+configs.ReleaseZLITE.deployment.scp.passphrase=
+configs.ReleaseZLITE.deployment.scp.password=
+configs.ReleaseZLITE.deployment.scp.port=22
+configs.ReleaseZLITE.deployment.scp.remotedir=
+configs.ReleaseZLITE.deployment.scp.server=
+configs.ReleaseZLITE.deployment.scp.usekeyfile=no
+configs.ReleaseZLITE.deployment.scp.userid=
+configs.ReleaseZLITE.deployment.webdav.password=
+configs.ReleaseZLITE.deployment.webdav.port=80
+configs.ReleaseZLITE.deployment.webdav.remotedir=
+configs.ReleaseZLITE.deployment.webdav.server=
+configs.ReleaseZLITE.deployment.webdav.userid=
+configs.ReleaseZLITE.javac.debug=false
+configs.ReleaseZLITE.javac.deprecation=true
+configs.ReleaseZLITE.javac.encoding=Cp1251
+configs.ReleaseZLITE.javac.optimize=true
+configs.ReleaseZLITE.libs.classpath=resources/MIDP2_ReleaseZLITE;resources/text_ReleaseZLITE
+configs.ReleaseZLITE.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n
+configs.ReleaseZLITE.manifest.manifest=
+configs.ReleaseZLITE.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n
+configs.ReleaseZLITE.obfuscation.custom=
+configs.ReleaseZLITE.obfuscation.level=9
+configs.ReleaseJZLIB.abilities=_MAX_COMPRESSION=,FILE_TRANSFER=,_HTTPCONNECT=,CLIPBOARD=,MOTOROLA_BACKLIGHT=,ZLIB=,CAPTCHA=,_XML_STREAM_DEBUG=,_GAMES=,TRAFFIC=,PEP=,SASL_XGOOGLETOKEN=,CHANGE_TRANSPORT=,_NONSASL_ENABLE=,FILE_IO=,PEP_TUNE=,LIGHT_CONTROL=,ARCHIVE_ADVANCED=,COLOR_THEMES=,_LOCALE_DEBUG=,_DEBUG=
configs.ReleaseJZLIB.deployment.copy.target=ftp/midp2.0z
configs.ReleaseJZLIB.deployment.ftp.passive=false
configs.ReleaseJZLIB.deployment.ftp.password=
@@ -50,7 +119,7 @@
configs.ReleaseJZLIB.deployment.ftp.separator=/
configs.ReleaseJZLIB.deployment.ftp.server=
configs.ReleaseJZLIB.deployment.ftp.userid=
-configs.ReleaseJZLIB.deployment.jarurl=http://bombus-im.org/builds/beta/midp2.0z/${dist.jar}
+configs.ReleaseJZLIB.deployment.jarurl=
configs.ReleaseJZLIB.deployment.method=Copy
configs.ReleaseJZLIB.deployment.override.jarurl=true
configs.ReleaseJZLIB.deployment.scp.keyfile=${file.reference.JAVA-Bombus}
@@ -70,21 +139,14 @@
configs.ReleaseJZLIB.javac.deprecation=true
configs.ReleaseJZLIB.javac.encoding=Cp1251
configs.ReleaseJZLIB.javac.optimize=true
-configs.ReleaseJZLIB.libs.classpath=resources/zlib;resources/text;resources/MIDP2;resources/themes;resources/pep
+configs.ReleaseJZLIB.libs.classpath=resources/zlib;resources/text;resources/MIDP2;resources/themes;resources/pep;resources/icon
configs.ReleaseJZLIB.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n
configs.ReleaseJZLIB.manifest.manifest=
-configs.ReleaseJZLIB.manifest.others=MIDlet-Vendor: Evgs\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Name: Bombus\nMIDlet-Version: $MIDLETVERSION$\n
+configs.ReleaseJZLIB.manifest.midlets=MIDlet-1: Bombus+,/_icon.png,midlet.Bombus\n
+configs.ReleaseJZLIB.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n
configs.ReleaseJZLIB.obfuscation.custom=
configs.ReleaseJZLIB.obfuscation.level=9
-configs.ReleaseJZLIB.platform.active=J2ME_Wireless_Toolkit_2_2
-configs.ReleaseJZLIB.platform.active.description=J2ME Wireless Toolkit 2.2
-configs.ReleaseJZLIB.platform.apis=JSR75-1.0,JSR172-1.0,JSR82-1.0,JSR184-1.0,MMAPI-1.1,WMA-2.0
-configs.ReleaseJZLIB.platform.bootclasspath=${platform.home}/lib/wma20.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/jsr184.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/cldcapi10.jar:${platform.home}/lib/midpapi20.jar
-configs.ReleaseJZLIB.bombus.bootclasspath=:bootclasspath/legacyfs.jar:bootclasspath/sielightapi.jar
-configs.ReleaseJZLIB.platform.configuration=CLDC-1.0
-configs.ReleaseJZLIB.platform.device=MediaControlSkin
-configs.ReleaseJZLIB.platform.profile=MIDP-2.0
-configs.ReleaseZH.abilities=MIDP2,ZLIB=,FILE_IO=,FILE_TRANSFER=,PEP=,MOTOROLA_BACKLIGHT=,SIEMENS_BACKLIGHT=,COLOR_THEMES=,SASL_XGOOGLETOKEN=
+configs.ReleaseZH.abilities=MEM_STAT,FILE_TRANSFER=,CLIPBOARD=,MOTOROLA_BACKLIGHT=,ZLIB=,CAPTCHA=,SIEMENS_BACKLIGHT=,PEP=,SASL_XGOOGLETOKEN=,PEP_TUNE=,FILE_IO=,LIGHT_CONTROL=,ARCHIVE_ADVANCED=,COLOR_THEMES=,MIDP2
configs.ReleaseZH.deployment.copy.target=ftp/midp2.0zh
configs.ReleaseZH.deployment.ftp.passive=false
configs.ReleaseZH.deployment.ftp.password=
@@ -93,7 +155,7 @@
configs.ReleaseZH.deployment.ftp.separator=/
configs.ReleaseZH.deployment.ftp.server=
configs.ReleaseZH.deployment.ftp.userid=
-configs.ReleaseZH.deployment.jarurl=http://bombus-im.org/builds/beta/midp2.0zh/${dist.jar}
+configs.ReleaseZH.deployment.jarurl=
configs.ReleaseZH.deployment.method=Copy
configs.ReleaseZH.deployment.override.jarurl=true
configs.ReleaseZH.deployment.scp.keyfile=ftp/midp2.0zh
@@ -113,23 +175,16 @@
configs.ReleaseZH.javac.deprecation=true
configs.ReleaseZH.javac.encoding=Cp1251
configs.ReleaseZH.javac.optimize=true
-configs.ReleaseZH.libs.classpath=resources/zlib:resources/text:resources/MIDP2;resources/themes;resources/pep
+configs.ReleaseZH.libs.classpath=resources/zlib:resources/text:resources/MIDP2;resources/themes;resources/pep;resources/icon
configs.ReleaseZH.manifest.apipermissions=MIDlet-Permissions: javax.microedition.io.Connector.file.read, javax.microedition.io.Connector.file.write, javax.microedition.io.Connector.http, javax.microedition.io.Connector.https, javax.microedition.io.Connector.ssl, javax.microedition.io.Connector.socket, javax.microedition.io.Connector.serversocket, javax.microedition.io.PushRegistry, javax.microedition.media.control.VideoControl.getSnapshot, javax.microedition.pim.ContactList.read, javax.microedition.pim.ContactList.write, javax.microedition.pim.EventList.read, javax.microedition.pim.EventList.write\n
configs.ReleaseZH.manifest.jad=Bombus-Version: $BOMBUSVERSION$\nBackground: True\nFlipInsensitive: True\n
configs.ReleaseZH.manifest.manifest=
-configs.ReleaseZH.manifest.others=MIDlet-Vendor: Evgs\nMIDlet-Name: Bombus\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n
+configs.ReleaseZH.manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Description: MIDP Jabber Client\nMIDlet-Version: $MIDLETVERSION$\n
configs.ReleaseZH.obfuscation.custom=
configs.ReleaseZH.obfuscation.level=9
-configs.ReleaseZH.platform.active=J2ME_Wireless_Toolkit_2_2
-configs.ReleaseZH.platform.active.description=J2ME Wireless Toolkit 2.2
-configs.ReleaseZH.platform.apis=JSR75-1.0,JSR172-1.0,MMAPI-1.1,WMA-2.0
-configs.ReleaseZH.platform.bootclasspath=${platform.home}/lib/wma20.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/cldcapi10.jar:${platform.home}/lib/midpapi20.jar
-configs.ReleaseZH.platform.configuration=CLDC-1.0
-configs.ReleaseZH.platform.device=MediaControlSkin
-configs.ReleaseZH.platform.profile=MIDP-2.0
configs.ReleaseZH.sign.alias=halmer
configs.ReleaseZH.sign.enabled=true
-configs.ReleaseZH.sign.keystore=${file.reference.keystore.ks}
+configs.ReleaseZH.sign.keystore==${file.reference.keystore.ks}
configs.ReleaseZH.sign.keystorehalmer/keystore.ks
deployment.copy.target=${file.reference.-TEMP_WIN}
deployment.jarurl=${dist.jar}
@@ -148,7 +203,7 @@
file.reference.midp2.0z=ftp/midp2.0z
file.reference.midp2.0zh=ftp/midp2.0zh
filter.exclude.tests=false
-filter.excludes=archive/DebugDumpArchive.java,ui/ScreenManager.java,Messages/MessageView.java,com/alsutton/jabber/datablocks/IqGetVCard.java
+filter.excludes=ui/ScreenManager.java,archive/DebugDumpArchive.java
filter.use.standard=true
jar.compress=true
javac.debug=true
@@ -167,12 +222,12 @@
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
-libs.classpath=resources/zlib;resources/text;resources/MIDP2;resources/themes;resources/pep
+libs.classpath=resources/zlib;resources/text;resources/MIDP2;resources/themes;resources/pep;resources/icon
manifest.apipermissions=
manifest.jad=Bombus-Version: $BOMBUSVERSION$\n
manifest.manifest=
manifest.midlets=MIDlet-1: Bombus,/_icon.png,midlet.Bombus\n
-manifest.others=MIDlet-Vendor: Evgs\nMIDlet-Icon: /_icon.png\nMIDlet-Version: $MIDLETVERSION$\nMIDlet-Name: Bombus\n
+manifest.others=MIDlet-Vendor: Evgs (mod by voffk)\nMIDlet-Name: Bombus+\nMIDlet-Icon: /_icon.png\nMIDlet-Version: $MIDLETVERSION$\n
manifest.pushregistry=
name=Bombus
no.dependencies=false
@@ -181,11 +236,11 @@
obfuscation.level=0
obfuscator.destjar=${build.dir}/obfuscated.jar
obfuscator.srcjar=${build.dir}/before-obfuscation.jar
-platform.active=J2ME_Wireless_Toolkit_2_2
-platform.active.description=J2ME Wireless Toolkit 2.2
+platform.active=Sun_Java_Wireless_Toolkit__2_3
+platform.active.description=Sun Java Wireless Toolkit 2.3
platform.apis=JSR75-1.0,JSR172-1.0,JSR82-1.0,JSR184-1.0,MMAPI-1.1,OBEX-1.0,WMA-2.0
-bombus.bootclasspath=:bootclasspath/legacyfs.jar:bootclasspath/sielightapi.jar
-platform.bootclasspath=${platform.home}/lib/wma20.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/jsr184.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/cldcapi10.jar:${platform.home}/lib/midpapi20.jar
+bombus.bootclasspath=:bootclasspath/legacyfs.jar:bootclasspath/sielightapi.jar:bootclasspath/nokialightapi.jar
+platform.bootclasspath=${platform.home}/lib/jsr75.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/jsr184.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/wma20.jar:${platform.home}/lib/midpapi20.jar:${platform.home}/lib/cldcapi10.jar
platform.configuration=CLDC-1.0
platform.device=DefaultColorPhone
platform.profile=MIDP-2.0
Index: bombus-plus/export/trunk/nbproject/project.xml
===================================================================
--- bombus-plus/export/trunk/nbproject/project.xml (revision 1363)
+++ bombus-plus/export/trunk/nbproject/project.xml (working copy)
@@ -5,10 +5,12 @@
ReleaseJZLIB
ReleaseZH
+ ReleaseZLITE
+ ReleaseZVOFFK
Release
- Bombus
+ Bombus+
1.6
Index: bombus-plus/export/trunk/nbproject/private/private.properties
===================================================================
--- bombus-plus/export/trunk/nbproject/private/private.properties (revision 1363)
+++ bombus-plus/export/trunk/nbproject/private/private.properties (working copy)
@@ -1,7 +1,11 @@
-#Thu May 01 19:22:58 GMT 2008
+#Sun Nov 18 18:59:37 GMT 2007
file.reference.-TEMP_WIN=D\:\\TEMP_WIN
-netbeans.user=C\:\\Documents and Settings\\evgs\\.netbeans\\5.5
+file.reference.bombus-bombus-plus=D:\\TOOLS\\bombus\\bombus-plus
+file.reference.builtin.ks=C:\\Documents and Settings\\Nemo\\.netbeans\\5.5.1\\config\\j2me\\builtin.ks
+file.reference.builtin.ks-1=C:\\Documents and Settings\\Nemo\\.netbeans\\5.5.1\\config\\j2me\\builtin.ks
+file.reference.midp2.0=D:\\TOOLS\\bombus\\bombus-plus\\ftp\\midp2.0
+netbeans.user=C:\\Documents and Settings\\Nemo\\.netbeans\\5.5.1
javadoc.preview=true
-deployment.counter=000582
-config.active=
-deployment.number=0.5.81
+deployment.counter=000570
+config.active=ReleaseJZLIB
+deployment.number=0.5.69
Index: bombus-plus/export/trunk/src/archive/MessageArchive.java
===================================================================
--- bombus-plus/export/trunk/src/archive/MessageArchive.java (revision 1363)
+++ bombus-plus/export/trunk/src/archive/MessageArchive.java (working copy)
@@ -132,4 +132,26 @@
//new MessageArchive()
} catch (Exception e) { e.printStackTrace(); }
}
+
+ public void deleteAll() {//
+ try {
+ int i=-1;
+ int num=rs.getNumRecords();
+ while (true) {
+ i=i+1;
+ rs.deleteRecord(getRecordId(i));
+ if (num==i) break;
+ }
+ } catch (Exception e) {}
+ try {
+ indexes.removeAllElements();
+ } catch (Exception e) {}
+ }
+
+// public void add(Msg msg) { //
+// try {
+// store(msg);
+// indexes.insertElementAt(msg, 0);
+// } catch (Exception e) {}
+// }
}
Index: bombus-plus/export/trunk/src/archive/ArchiveList.java
===================================================================
--- bombus-plus/export/trunk/src/archive/ArchiveList.java (revision 1363)
+++ bombus-plus/export/trunk/src/archive/ArchiveList.java (working copy)
@@ -37,10 +37,33 @@
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
-import javax.microedition.lcdui.TextBox;
+//import javax.microedition.lcdui.TextBox;
import locale.SR;
-import ui.ComplexString;
+//import ui.ComplexString;
import ui.YesNoAlert;
+//#if ARCHIVE_ADVANCED
+//
+import Client.Contact;
+import Client.Groups;
+import Client.StaticData;
+import java.util.Enumeration;
+ //#if FILE_IO
+import io.file.FileIO;
+import io.file.browse.Browser;
+import io.file.browse.BrowserListener;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import Client.Config;
+import ui.Time;
+import util.strconv;
+ //#endif
+//#endif
+//#ifdef CLIPBOARD
+//# import util.ClipBoard;
+//# import Client.Config;
+//#endif
+//
/**
*
@@ -49,32 +72,103 @@
public class ArchiveList
extends MessageList
implements YesNoAlert.YesNoListener
+//#if (FILE_IO && ARCHIVE_ADVANCED)
+ , BrowserListener
+//#endif
{
Command cmdDelete=new Command(SR.MS_DELETE /*"Delete"*/, Command.SCREEN, 9);
- Command cmdPaste=new Command(SR.MS_PASTE_BODY /*"Paste Body"*/, Command.SCREEN, 1);
- Command cmdSubj=new Command(SR.MS_PASTE_SUBJECT /*"Paste Subject"*/, Command.SCREEN, 3);
- Command cmdJid=new Command(SR.MS_PASTE_JID /*"Paste Jid"*/, Command.SCREEN, 2);
+ Command cmdPaste=new Command(SR.MS_PASTE, Command.SCREEN, 1); //
+//#if ReleaseZVOFFK
+//# Command cmdPasteSpecial=new Command("Paste + ~~~~~~~", Command.SCREEN, 2);
+//#endif
+ //Command cmdSubj=new Command(SR.MS_PASTE_SUBJECT /*"Paste Subject"*/, Command.SCREEN, 3);
+ Command cmdJid=new Command(SR.MS_PASTE_JID /*"Paste Jid"*/, Command.SCREEN, 3); //
//Command cmdNick=new Command("Paste Nickname", Command.SCREEN, 3);
+ Command cmdEdit=new Command(SR.MS_EDIT, Command.SCREEN, 14); //
+ Command cmdNew=new Command(SR.MS_NEW_MESSAGE, Command.SCREEN, 15); //
+//#if ARCHIVE_ADVANCED
+ //#if (FILE_IO)
+ Command cmdExport=new Command(SR.MS_MAKE_BACKUP, Command.SCREEN, 17);
+ Command cmdImport=new Command(SR.MS_IMPORT_FROM_BACKUP, Command.SCREEN, 18);
+ //#endif
+ Command cmdExportRoster=new Command("Roster->archive", Command.SCREEN, 19);
+ private StaticData sd=StaticData.getInstance();
+//#endif
+
+ Command cmdDeleteAll=new Command("Delete all!", Command.SCREEN, 20); //
+
+ byte yesNoAction=0; //
MessageArchive archive=new MessageArchive();
MessageEdit target;
+ private int caretPos;
+
+//#if ARCHIVE_ADVANCED
+ //#if FILE_IO
+ private final static int EXPORT=0;
+ private final static int IMPORT=1;
- private int caretPos;
+ private int filePos;
+ private FileIO file;
+ private OutputStream os;
+
+ private int returnVal=0;
+
+ private String start_item="";
+ private String end_item="";
+
+ private String start_date="";
+ private String end_date="";
+
+ private String start_from="";
+ private String end_from="";
+
+ private String start_subj="";
+ private String end_subj="";
+
+ private String start_body="";
+ private String end_body="";
+ //#endif
+//#endif
+
+//#ifdef CLIPBOARD
+//# private ClipBoard clipboard;
+//#endif
+
/** Creates a new instance of ArchiveList */
public ArchiveList(Display display, MessageEdit target, int caretPos) {
super ();
this.target=target;
this.caretPos=caretPos;
+
+//#ifdef CLIPBOARD
+//# if (Config.getInstance().useClipBoard)
+//# clipboard=ClipBoard.getInstance();
+//#endif
+
setCommandListener(this);
addCommand(cmdBack);
addCommand(cmdDelete);
-
+ addCommand(cmdEdit); //
+ addCommand(cmdNew); //
+ addCommand(cmdDeleteAll); //
+//#if ARCHIVE_ADVANCED
+ //#if (FILE_IO)
+ addCommand(cmdExport);
+ addCommand(cmdImport);
+ //#endif
+ addCommand(cmdExportRoster);
+//#endif
+
if (target!=null) {
addCommand(cmdPaste);
+//#if ReleaseZVOFFK
+//# addCommand(cmdPasteSpecial);
+//#endif
addCommand(cmdJid);
//TODO: re-enable item-specific dynamic commands)
- addCommand(cmdSubj);
+ //addCommand(cmdSubj);
}
attachDisplay(display);
@@ -88,14 +182,14 @@
title.addElement(null);
title.addRAlign();
title.addElement(null);
- title.addElement(SR.MS_FREE /*"free "*/);
+ title.addElement(/*SR.MS_FREE*/ "free "); //
setTitleItem(title);
}
protected void beginPaint() {
getTitleItem().setElementAt(" ("+String.valueOf(getItemCount())+")",1);
- getTitleItem().setElementAt(String.valueOf(archive.freeSpace()),3);
+ getTitleItem().setElementAt(String.valueOf(archive.freeSpace())+" kb",3);
}
public int getItemCount() {
@@ -108,50 +202,147 @@
public void commandAction(Command c, Displayable d) {
super.commandAction(c,d);
- if (c==cmdDelete) { deleteMessage(); }
+ if (c==cmdDelete) { //
+ yesNoAction=1;
+ new YesNoAlert(display, SR.MS_DELETE, SR.MS_SURE_DELETE, this);
+ }
if (c==cmdPaste) { pasteData(0); }
- if (c==cmdSubj) { pasteData(1); }
+//#if ReleaseZVOFFK
+//# if (c==cmdPasteSpecial) { pasteData(1); }
+//#endif
+ //if (c==cmdSubj) { pasteData(1); } //
if (c==cmdJid) { pasteData(2); }
+ if (c==cmdEdit) { //
+ try {
+ new ArchiveEdit(display, getMessage(cursor), true);
+ deleteMessage();
+ } catch (Exception e) {/*no messages*/}
+ }
+ if (c==cmdNew) { //
+ new ArchiveEdit(display, new Msg(Msg.MESSAGE_TYPE_OUT, "me", null, null), false);
+ }
+ if (c==cmdDeleteAll) { //
+ yesNoAction=2;
+ new YesNoAlert(display, "Delete all!", "Are you sure want to delete all messages?", this);
+ }
+//#if ARCHIVE_ADVANCED
+ //#if FILE_IO
+ if (c==cmdExport) {
+ returnVal=EXPORT;
+ new Browser(null, display, this, true);
+ }
+ if (c==cmdImport) {
+ returnVal=IMPORT;
+ new Browser(null, display, this, false);
+ }
+ //#endif
+ if (c==cmdExportRoster) { //
+ Vector hcontacts=sd.roster.getHContacts();
+ StringBuffer dump=new StringBuffer();
+ for (Enumeration e=hcontacts.elements(); e.hasMoreElements();){
+ Contact k=(Contact) e.nextElement();
+ /*int grpType=k.getGroupType();
+ if (grpType==Groups.TYPE_NO_GROUP || grpType==Groups.TYPE_COMMON || grpType==Groups.TYPE_IGNORE || grpType==Groups.TYPE_TRANSP) {*/
+ if ((k.origin==Contact.ORIGIN_ROSTER || k.origin==Contact.ORIGIN_ROSTERRES) && k.origin!=Contact.ORIGIN_CLONE && k.getGroupType()!=Groups.TYPE_SELF) {
+ /*JRU-PHP:
+ *These are the five columns: action, JID, name, subscription (none, to, from, both) and group name.
+ *Theyre comma-separated and if they contain commas theirselves, theyre additionally double-quoted.
+ */
+ //+,jid,nick,subscription,group
+ dump.append("+,");
+ dump.append( quoteCommas(k.getBareJid()) );
+ dump.append(",");
+ dump.append((k.nick!=null)?quoteCommas(k.nick):"");
+ dump.append(",");
+ dump.append(k.subscr);
+ dump.append(",");
+ String grpName=k.getGroup().getName();
+ dump.append((grpName!=SR.MS_TRANSPORTS && grpName!=SR.MS_GENERAL)?quoteCommas(grpName):"");
+ grpName=null;
+ dump.append("\r\n");
+ }
+ }
+ //new ArchiveEdit(display, new Msg(Msg.MESSAGE_TYPE_OUT, "me", "Roster <"+sd.account.getBareJid()+"> for JRU-PHP", dump.toString()), false); //buffer size of some phones is small!!!
+ archive.store(new Msg(Msg.MESSAGE_TYPE_OUT, "me", "Roster <"+sd.account.getBareJid()+"> for JRU-PHP", dump.toString()));
+ destroyView();
+ dump=null;
+ hcontacts=null;
+ }
+//#endif
}
-
+
private void deleteMessage() {
archive.delete(cursor);
messages=new Vector();
redraw();
}
-
- private void pasteData(int field) {
- if (target==null) return;
- Msg m=getMessage(cursor);
- if (m==null) return;
- String data;
- switch (field) {
- case 1:
- data=m.subject;
- break;
- case 2:
- data=m.from;
- break;
- default:
- data=m.quoteString();
- }
+
+ private void pasteData(int field) { //
+ if (target==null) return;
+ Msg m=getMessage(cursor);
+ if (m==null) return;
+ String data;
+ switch (field) {
+//#if ReleaseZVOFFK
+//# case 1:
+//# data=m.quoteString()+"\n~~~~~~~~~~~~~~~\n";
+//# break;
+//#endif
+ case 2:
+ data=m.from;
+ break;
+ default:
+ data=m.quoteString();
+ }
if (data==null) return;
target.insertText(data, caretPos);
- destroyView();
+ destroyView();
}
-
+
public void keyGreen() { pasteData(0); }
public void userKeyPressed(int keyCode) {
super.userKeyPressed(keyCode);
- if (keyCode==keyClear) {
- if (getItemCount()>0) new YesNoAlert(display, SR.MS_DELETE, SR.MS_SURE_DELETE, this);
+//#if ReleaseZVOFFK
+//# if (keyCode=='9') //+"~~~~~~~"
+//# pasteData(1);
+//#endif
+//#if CLIPBOARD
+//# if (keyCode=='3') { //copy+ jid from Msg
+//# try {
+//# StringBuffer clipstr=new StringBuffer();
+//# clipstr.append(clipboard.getClipBoard());
+//# clipstr.append("\n\n");
+//# clipstr.append((getMessage(cursor)).from);
+//# clipboard.setClipBoard(clipstr.toString());
+//# clipstr=null;
+//# } catch (Exception e) {/*no messages*/}
+//# }
+//#endif
+ if (keyCode==keyClear || keyCode=='0') { //clear
+ if (getItemCount()>0) {
+ yesNoAction=1;
+ new YesNoAlert(display, SR.MS_DELETE, SR.MS_SURE_DELETE, this);
+ }
}
}
- public void ActionConfirmed() {
- deleteMessage();
+
+ public void ActionConfirmed() {//
+ switch (yesNoAction) {
+ case 1:
+ deleteMessage();
+ break;
+ case 2:
+ deleteAllMessages();
+ break;
+ }
}
+ private void deleteAllMessages() {//
+ archive.deleteAll();
+ messages=new Vector();
+ }
+
/*public void focusedItem(int index) {
if (target==null) return;
try {
@@ -167,5 +358,162 @@
super.destroyView();
archive.close();
}
+
+//#if ARCHIVE_ADVANCED
+ private static String quoteCommas(String src) {
+ return ((src.indexOf(",")>-1)?"\""+src+"\"":src);
+ }
+ //#if FILE_IO
+ public Vector importData(String archPath) {
+ Vector vector=new Vector();
+ byte[] bodyMessage;
+ String archive="";
+ bodyMessage=readFile(archPath);
+
+ if (bodyMessage!=null) {
+ if (Config.getInstance().cp1251) {
+ archive=strconv.convCp1251ToUnicode(new String(bodyMessage, 0, bodyMessage.length));
+ } else {
+ archive=new String(bodyMessage, 0, bodyMessage.length);
+ }
+ }
+
+ if (archive!=null) {
+ try {
+ int pos=0;
+ int start_pos=0;
+ int end_pos=0;
+
+ while (true) {
+ String date=null; String from=null; String subj=null; String body=null; String tempstr=null;
+ start_pos=archive.indexOf(start_item,pos); end_pos=archive.indexOf(end_item,pos);
+
+ if (start_pos>-1 && end_pos>-1) {
+ tempstr=archive.substring(start_pos+start_item.length(), end_pos);
+ date=findBlock(tempstr, start_date, end_date);
+ from=findBlock(tempstr, start_from, end_from);
+ subj=findBlock(tempstr, start_subj, end_subj);
+ body=findBlock(tempstr, start_body, end_body);
+ //System.out.println("["+date+"]"+from+": "+subj+" "+body+"\r\n");
+ Msg msg = new Msg(Msg.MESSAGE_TYPE_IN, from, subj, body);
+ msg.setDayTime(date);
+ vector.insertElementAt(msg, 0);
+ } else
+ break;
+
+ pos=end_pos+end_item.length();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ bodyMessage=null;
+ archPath=null;
+
+ return vector;
+ }
+
+ private String findBlock(String source, String _start, String _end){
+ String block = "";
+ int start =source.indexOf(_start); int end = source.indexOf(_end);
+ if (start<0 || end<0)
+ return block;
+ return source.substring(start+_start.length(), end);
+ }
+
+ public void exportData(String archPath) {
+ byte[] bodyMessage;
+ int items=getItemCount();
+ StringBuffer body=new StringBuffer();
+
+ for(int i=0; i
+import Client.Contact;
+import Client.Msg;
+import Client.Roster;
+import locale.SR;
+import ui.Time;
+//
/**
*
@@ -40,27 +47,101 @@
public IqTimeReply(){};
- public int blockArrived(JabberDataBlock data) {
+ public int blockArrived(JabberDataBlock data) { //
if (!(data instanceof Iq)) return BLOCK_REJECTED;
- if (!data.getAttribute("type").equals("get")) return BLOCK_REJECTED;
+ String type=data.getTypeAttribute();
+ String from=data.getAttribute("from");
+ Roster roster=StaticData.getInstance().roster;
- JabberDataBlock query=data.findNamespace("query", "jabber:iq:time");
- if (query!=null) {
- query.addChild("utc",ui.Time.Xep0082UtcTime());
- query.addChild("display", ui.Time.dispLocalTime());
- } else {
- query=data.findNamespace("time", "urn:xmpp:time");
- if (query==null) return BLOCK_REJECTED;
- query.addChild("utc",ui.Time.utcTime());
- query.addChild("tzo", ui.Time.tzOffset());
+ if (type.equals("get")) {
+
+ JabberDataBlock query=data.findNamespace("query", "jabber:iq:time");
+ if (query!=null) {
+ query.addChild("utc", Time.Xep0082UtcTime());
+ query.addChild("display", Time.dispLocalTime() + " - :("); //
+ } else {
+ query=data.findNamespace("time", "urn:xmpp:time");
+ if (query==null) return BLOCK_REJECTED;
+ query.addChild("utc", Time.utcTime());
+ query.addChild("tzo", Time.tzOffset());
+ }
+
+ Contact c=roster.getContact(from, true);
+ c.setIncoming(Contact.INC_VIEWING);
+ Iq reply=new Iq(from, Iq.TYPE_RESULT, data.getAttribute("id"));
+ reply.addChild(query);
+
+ roster.theStream.send(reply);
+
+ return JabberBlockListener.BLOCK_PROCESSED;
+
}
- Iq reply=new Iq(data.getAttribute("from"), Iq.TYPE_RESULT, data.getAttribute("id"));
- reply.addChild(query);
-
- StaticData.getInstance().roster.theStream.send(reply);
-
- return JabberBlockListener.BLOCK_PROCESSED;
-
+ if (data.getAttribute("id").equals("gettime")) {
+
+ String body=null;
+
+ if (type.equals("error")) {
+ body="error";
+ roster.querysign=false;
+ } else if (type.equals("result")) {
+ JabberDataBlock tm=data.getChildBlock(/*"time"*/"query");
+ if (tm!=null) {
+ body=dispatchTime(tm);
+ }
+ roster.querysign=false;
+ }
+ if (body!=null) {
+ Msg m=new Msg(Msg.MESSAGE_TYPE_IN, from, SR.MS_TIME, body);
+ roster.messageStore( roster.getContact(from, false), m);
+ roster.redraw();
+ return BLOCK_PROCESSED;
+ }
+ }
+ return BLOCK_REJECTED;
}
+
+ public static JabberDataBlock query(String to){ //
+ JabberDataBlock result=new Iq(to, Iq.TYPE_GET, "gettime");
+ result.addChildNs("query", "jabber:iq:time"); //XEP-0090
+ //result.addChildNs("time", "urn:xmpp:time"); //XEP-0202
+ return result;
+ }
+
+ public static String dispatchTime(JabberDataBlock data) {//XEP-0090
+ if (!data.isJabberNameSpace("jabber:iq:time")) return "unknown time namespace";
+ StringBuffer tm=new StringBuffer();
+ String field=data.getChildBlockText("display");
+ //System.out.println(field);
+ if (field.length()>0) {
+ tm.append(field);
+ }
+ return tm.toString();
+ }
+
+ /*public static String dispatchTime(JabberDataBlock data) {//XEP-0202
+ if (!data.isJabberNameSpace("urn:xmpp:time")) return "unknown time namespace";
+ String utc=data.getChildBlockText("utc");
+ String tzo=data.getChildBlockText("tzo");
+ StringBuffer tm=new StringBuffer();
+ try {
+ long date=Time.dateIso8601(utc);
+ long tzoOffsetMillis=Integer.parseInt(tzo.substring(1, 3))*60*60*1000+Integer.parseInt(tzo.substring(4, 6))*60*1000;
+ if (tzo.startsWith("-"))
+ date-=tzoOffsetMillis;
+ else
+ date+=tzoOffsetMillis;
+ tm.append(Time.dayLocalString(date));
+ tm.append(Time.timeLocalString(date));
+ if (tzo.equals("Z")) {
+ tm.append(" (UTC");
+ } else {
+ tm.append(" (GMT");
+ tm.append(tzo);
+ }
+ tm.append(")");
+ } catch (Exception e) {}
+ //System.out.println(tm.toString());
+ return tm.toString();
+ }*/
}
Index: bombus-plus/export/trunk/src/xmpp/extensions/pep/PepListener.java
===================================================================
--- bombus-plus/export/trunk/src/xmpp/extensions/pep/PepListener.java (revision 1363)
+++ bombus-plus/export/trunk/src/xmpp/extensions/pep/PepListener.java (working copy)
@@ -39,6 +39,7 @@
public PepListener() { }
public int blockArrived(JabberDataBlock data) {
+//#if PEP
if (!(data instanceof Message)) return BLOCK_REJECTED;
//if (!data.getTypeAttribute().equals("headline")) return BLOCK_REJECTED;
@@ -51,6 +52,7 @@
StringBuffer result=new StringBuffer();
+ //#if PEP_TUNE
boolean tuneVaule=false;
JabberDataBlock tune=extractEvent(event, "tune", "http://jabber.org/protocol/tune");
if (tune!=null) {
@@ -72,8 +74,11 @@
tuneVaule=true;
}
+ //#if DEBUG
System.out.println(from+": "+result.toString());
+ //#endif
}
+ //#endif
int moodIndex=-1;
JabberDataBlock mood=extractEvent(event, "mood", "http://jabber.org/protocol/mood");
@@ -99,15 +104,26 @@
}
result.append(Moods.getInstance().getMoodLabel(moodIndex));
- result.append(" - ");
+ //result.append(" - "); //<-voffk>
moodText=mood.getChildBlockText("text");
+ if (moodText.length()!=0) //<+voffk>
+ {
+ result.append(" [");
result.append(moodText);
+ result.append("]");
+ }
+ //#if DEBUG
System.out.println(from+": "+result.toString());
+ //#endif
}
- Msg m=new Msg(Msg.MESSAGE_TYPE_HISTORY, from, null, result.toString());
+ //#if PEP_TUNE
+ Msg m=new Msg((tuneVaule)?Msg.MESSAGE_TYPE_HISTORY:Msg.MESSAGE_TYPE_MOOD, from, null, result.toString());
+ //#else
+//# Msg m=new Msg(Msg.MESSAGE_TYPE_MOOD, from, null, result.toString());
+ //#endif
Vector hContacts=StaticData.getInstance().roster.getHContacts();
synchronized (hContacts) {
@@ -124,7 +140,9 @@
Moods.getInstance().myMoodName=moodText;
}
}
+ //#if PEP_TUNE
if (tune!=null) c.pepTune=tuneVaule;
+ //#endif
c.addMessage(m);
}
}
@@ -133,8 +151,12 @@
StaticData.getInstance().roster.redraw();
return BLOCK_PROCESSED;
+//#else
+//# return BLOCK_REJECTED;
+//#endif
}
+//#if PEP
JabberDataBlock extractEvent(JabberDataBlock data, String tagName, String xmlns) {
JabberDataBlock items=data.getChildBlock("items");
if (items==null) return null;
@@ -143,4 +165,5 @@
if (item==null) return new JabberDataBlock();
return item.findNamespace(tagName, xmlns);
}
+//#endif
}
Index: bombus-plus/export/trunk/src/xmpp/extensions/XDataField.java
===================================================================
--- bombus-plus/export/trunk/src/xmpp/extensions/XDataField.java (revision 1363)
+++ bombus-plus/export/trunk/src/xmpp/extensions/XDataField.java (working copy)
@@ -12,7 +12,7 @@
import com.alsutton.jabber.JabberDataBlock;
import java.util.*;
import javax.microedition.lcdui.*;
-import ui.ConstMIDP;
+//import ui.ConstMIDP; <-voffk>
import util.strconv;
/**
@@ -74,7 +74,7 @@
else if (type.equals("list-single") || type.equals("list-multi")) {
int choiceType=(type.equals("list-single"))?
- ConstMIDP.CHOICE_POPUP : ChoiceGroup.MULTIPLE;
+ ChoiceGroup.POPUP : ChoiceGroup.MULTIPLE; //<*voffk>
ChoiceGroup ch=new ChoiceGroup(label, choiceType);
formItem=ch;
Index: bombus-plus/export/trunk/src/xmpp/extensions/IqVersionReply.java
===================================================================
--- bombus-plus/export/trunk/src/xmpp/extensions/IqVersionReply.java (revision 1363)
+++ bombus-plus/export/trunk/src/xmpp/extensions/IqVersionReply.java (working copy)
@@ -43,13 +43,17 @@
public int blockArrived(JabberDataBlock data) {
if (!(data instanceof Iq)) return BLOCK_REJECTED;
- String type=data.getAttribute("type");
+ String type=data.getTypeAttribute();
+ String from=data.getAttribute("from");
if (type.equals("get")) {
JabberDataBlock query=data.findNamespace("query", "jabber:iq:version");
if (query==null) return BLOCK_REJECTED;
- Iq reply=new Iq(data.getAttribute("from"), Iq.TYPE_RESULT, data.getAttribute("id"));
+ Contact c=StaticData.getInstance().roster.getContact(from, true);
+ c.setIncoming(Contact.INC_VIEWING);
+
+ Iq reply=new Iq(from, Iq.TYPE_RESULT, data.getAttribute("id"));
//JabberDataBlock query=reply.addChildNs("query", "jabber:iq:version"); reuse existing request
reply.addChild(query);
query.addChild("name", Version.NAME);
@@ -78,7 +82,7 @@
Client.Roster roster=StaticData.getInstance().roster;
Msg m=new Msg(Msg.MESSAGE_TYPE_IN, "ver", locale.SR.MS_CLIENT_INFO, body);
- roster.messageStore( roster.getContact( data.getAttribute("from"), false), m);
+ roster.messageStore( roster.getContact(from, false), m);
roster.querysign=false;
roster.redraw();
return JabberBlockListener.BLOCK_PROCESSED;
Index: bombus-plus/export/trunk/src/xmpp/extensions/IqLast.java
===================================================================
--- bombus-plus/export/trunk/src/xmpp/extensions/IqLast.java (revision 1363)
+++ bombus-plus/export/trunk/src/xmpp/extensions/IqLast.java (working copy)
@@ -32,7 +32,12 @@
import com.alsutton.jabber.JabberDataBlock;
import com.alsutton.jabber.datablocks.*;
import ui.Time;
-
+//
+import Client.Contact;
+import Client.Msg;
+import Client.Roster;
+import locale.SR;
+//
/**
*
* @author EvgS
@@ -41,23 +46,76 @@
public IqLast(){ };
- public int blockArrived(JabberDataBlock data) {
+ public int blockArrived(JabberDataBlock data) { //
if (!(data instanceof Iq)) return BLOCK_REJECTED;
- if (!data.getAttribute("type").equals("get")) return BLOCK_REJECTED;
+ String type=data.getTypeAttribute();
+ String from=data.getAttribute("from");
+ Roster roster=StaticData.getInstance().roster;
- JabberDataBlock query=data.findNamespace("query", "jabber:iq:last");
- if (query==null) return BLOCK_REJECTED;
-
- long last=(Time.utcTimeMillis() - StaticData.getInstance().roster.lastMessageTime)/1000;
+ if (type.equals("get")) {
+
+ JabberDataBlock query=data.findNamespace("query", "jabber:iq:last");
+ if (query==null) return BLOCK_REJECTED;
+
+ Contact c=roster.getContact(from, true);
+ c.setIncoming(Contact.INC_VIEWING);
+
+ long last=(Time.utcTimeMillis() - roster.lastMessageTime)/1000;
- Iq reply=new Iq(data.getAttribute("from"), Iq.TYPE_RESULT, data.getAttribute("id"));
- //reply.addChildNs("query", "jabber:iq:last")
- reply.addChild(query);
- query.setAttribute("seconds", String.valueOf(last));
+ Iq reply=new Iq(from, Iq.TYPE_RESULT, data.getAttribute("id"));
+ //reply.addChildNs("query", "jabber:iq:last")
+ reply.addChild(query);
+ query.setAttribute("seconds", String.valueOf(last));
+
+ roster.theStream.send(reply);
+
+ return JabberBlockListener.BLOCK_PROCESSED;
+
+ }
- StaticData.getInstance().roster.theStream.send(reply);
+ if (data.getAttribute("id").equals("getlast")) {
+
+ String body=null;
+
+ if (type.equals("error")) {
+ body="error";
+ roster.querysign=false;
+ } else if (type.equals("result")) {
+ JabberDataBlock tm=data.getChildBlock("query");
+ if (tm!=null) {
+ body=IqLast.dispatchLast(tm);
+ }
+ roster.querysign=false;
+ }
+ if (body!=null) {
+ String lastType=SR.MS_PREVIOUS_STATUS;
+ if (from.indexOf("/")>-1) lastType=SR.MS_IDLE;
+ String status=(data.getChildBlockText("query").length()!=0)?" ("+data.getChildBlockText("query")+")":"";
+ Msg m=new Msg(Msg.MESSAGE_TYPE_IN, from, lastType, body+status);
+ roster.messageStore( roster.getContact(from, false), m);
+ roster.redraw();
+ return BLOCK_PROCESSED;
+ }
+ }
+ return BLOCK_REJECTED;
+ }
+
+ public static JabberDataBlock query(String to){ //
+ JabberDataBlock query=new Iq(to, Iq.TYPE_GET, "getlast");
+ query.addChildNs("query", "jabber:iq:last");
+ return query;
+ }
+
+ public static String dispatchLast(JabberDataBlock data) { //
+ if (!data.isJabberNameSpace("jabber:iq:last")) return "unknown last namespace";
+ StringBuffer tm=new StringBuffer();
+ String field=data.getAttribute("seconds");
- return JabberBlockListener.BLOCK_PROCESSED;
-
+ if (field!=null) {
+ tm.append(Time.secDiffToDate(Integer.parseInt(field)));
+ }
+ //System.out.println(tm.toString());
+ return tm.toString();
}
+
}
Index: bombus-plus/export/trunk/src/ServiceDiscovery/ServerBox.java
===================================================================
--- bombus-plus/export/trunk/src/ServiceDiscovery/ServerBox.java (revision 1363)
+++ bombus-plus/export/trunk/src/ServiceDiscovery/ServerBox.java (working copy)
@@ -29,7 +29,7 @@
import javax.microedition.lcdui.*;
import locale.SR;
-import ui.ConstMIDP;
+//import ui.ConstMIDP;
import ui.VirtualList;
import ui.controls.TextFieldCombo;
/**
@@ -56,7 +56,7 @@
f=new Form("Service Discovery");
f.append("Enter Jabber server address here");
- t=new TextFieldCombo("Address",service,500, ConstMIDP.TEXTFIELD_URL, MRU_ID, display);
+ t=new TextFieldCombo("Address",service,500, TextField.URL, MRU_ID, display); //
TextFieldCombo.setLowerCaseLatin(t);
f.append(t);
f.addCommand(cmdSend);
Index: bombus-plus/export/trunk/src/ServiceDiscovery/DiscoFeatures.java
===================================================================
--- bombus-plus/export/trunk/src/ServiceDiscovery/DiscoFeatures.java (revision 1363)
+++ bombus-plus/export/trunk/src/ServiceDiscovery/DiscoFeatures.java (working copy)
@@ -44,7 +44,7 @@
public class DiscoFeatures implements CommandListener{
Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 99);
- Command cmdOk=new Command(SR.MS_OK, Command.OK, 1);
+ //Command cmdOk=new Command(SR.MS_OK, Command.OK, 1);
List list;
@@ -62,7 +62,7 @@
}
list.addCommand(cmdBack);
- list.addCommand(cmdOk);
+ //list.addCommand(cmdOk);
parentView=display.getCurrent();
this.display=display;
Index: bombus-plus/export/trunk/src/ServiceDiscovery/FormField.java
===================================================================
--- bombus-plus/export/trunk/src/ServiceDiscovery/FormField.java (revision 1363)
+++ bombus-plus/export/trunk/src/ServiceDiscovery/FormField.java (working copy)
@@ -29,7 +29,12 @@
import javax.microedition.lcdui.*;
import com.alsutton.jabber.*;
import java.util.*;
-import ui.ConstMIDP;
+//import ui.ConstMIDP;
+//#if CLIPBOARD
+//# import ui.controls.StringItemEx;
+//# import ui.controls.TextFieldEx;
+//#endif
+
/**
*
* @author Evg_S
@@ -59,7 +64,11 @@
if (label==null) label=name;
body=field.getChildBlockText("value");
hidden= type.equals("hidden");
- if (type.equals("fixed")) formItem=new StringItem(label, body);
+//#if CLIPBOARD
+//# if (type.equals("fixed")) formItem=new StringItemEx(label, body);
+//#else
+ if (type.equals("fixed")) formItem=new StringItem(label, body);
+//#endif
else if (type.equals("boolean")) {
ChoiceGroup ch=new ChoiceGroup(null,ChoiceGroup.MULTIPLE);
formItem=ch;
@@ -73,7 +82,7 @@
else if (type.equals("list-single") || type.equals("list-multi")) {
int choiceType=(type.equals("list-single"))?
- ConstMIDP.CHOICE_POPUP : ChoiceGroup.MULTIPLE;
+ ChoiceGroup.POPUP : ChoiceGroup.MULTIPLE; //
ChoiceGroup ch=new ChoiceGroup(label, choiceType);
formItem=ch;
@@ -90,6 +99,31 @@
}
}
}
+//#if CLIPBOARD
+//# // text-single, text-private
+//# else {
+//# if (body.length()>=200) {
+//# body=body.substring(0,198);
+//# }
+//# int constrains=(type.equals("text-private"))? TextField.PASSWORD: TextField.ANY;
+//# formItem=new TextFieldEx(label, body, 200, constrains);
+//# }
+//# } else {
+//# // not x-data
+//# if ( instructions=name.equals("instructions") )
+//# formItem=new StringItemEx("Instructions", body);
+//# else if ( name.equals("title") )
+//# formItem=new StringItemEx(null, body);
+//# else if ( name.equals("registered") ) {
+//# ChoiceGroup cg=new ChoiceGroup("Registration", ChoiceGroup.MULTIPLE);
+//# cg.append("Remove registration", null);
+//# formItem=cg;
+//# registered=true;
+//# }
+//# else
+//# formItem=new TextFieldEx(label, body, 64, 0);
+//# }
+//#else
// text-single, text-private
else {
if (body.length()>=200) {
@@ -113,6 +147,7 @@
else
formItem=new TextField(label, body, 64, 0);
}
+//#endif
if (name!=null)
if ( name.equals("key") ) hidden=true;
Index: bombus-plus/export/trunk/src/ServiceDiscovery/ServiceDiscovery.java
===================================================================
--- bombus-plus/export/trunk/src/ServiceDiscovery/ServiceDiscovery.java (revision 1363)
+++ bombus-plus/export/trunk/src/ServiceDiscovery/ServiceDiscovery.java (working copy)
@@ -59,19 +59,19 @@
//private final static String strJoin="Join Conference";
- //private final static String strReg="Register";
- //private final static String strSrch="Search";
+ private final static String strReg="Register"; //
+ private final static String strSrch="Search"; //
private final static String strCmds="Execute";
private final int AD_HOC_INDEX=17;
private Command cmdOk=new Command(SR.MS_BROWSE, Command.SCREEN, 1);
private Command cmdRfsh=new Command(SR.MS_REFRESH, Command.SCREEN, 2);
- private Command cmdFeatures=new Command(SR.MS_FEATURES, Command.SCREEN, 3);
private Command cmdSrv=new Command(SR.MS_SERVER, Command.SCREEN, 10);
+ private Command cmdFeatures=new Command(SR.MS_FEATURES, Command.SCREEN, 20);
//private Command cmdAdd=new Command(SR.MS_ADD_TO_ROSTER, Command.SCREEN, 11); //FS#464 => this string is commented in SR.java'
private Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 98);
- private Command cmdCancel=new Command(SR.MS_CANCEL, Command.EXIT, 99);
-
+ private Command cmdCancel=new Command(SR.MS_CANCEL, Command.SCREEN, 99);
+
private StaticData sd=StaticData.getInstance();
private Vector items;
@@ -269,8 +269,8 @@
String var=i.getAttribute("var");
features.addElement(var);
//if (var.equals(NS_MUC)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_GCJOIN_INDEX, strJoin)); }
- if (var.equals(NS_SRCH)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_SEARCH_INDEX, SR.MS_SEARCH)); }
- if (var.equals(NS_REGS)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_REGISTER_INDEX, SR.MS_REGISTER)); }
+ if (var.equals(NS_SRCH)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_SEARCH_INDEX, /*SR.MS_SEARCH*/strSrch)); } //
+ if (var.equals(NS_REGS)) { cmds.addElement(new DiscoCommand(RosterIcons.ICON_REGISTER_INDEX, /*SR.MS_REGISTER*/strReg)); } //
if (var.equals(NS_GATE)) { showPartialResults=true; }
//if (var.equals(NODE_CMDS)) { cmds.addElement(new DiscoCommand(AD_HOC_INDEX,strCmds)); }
}
Index: bombus-plus/export/trunk/src/Info/InfoWindow.java
===================================================================
--- bombus-plus/export/trunk/src/Info/InfoWindow.java (revision 1363)
+++ bombus-plus/export/trunk/src/Info/InfoWindow.java (working copy)
@@ -57,29 +57,16 @@
if (icon==null) icon=Image.createImage("/_icon.png");
form.append(icon);
} catch (Exception e) { }
+ //
form.append(Version.getNameVersion()+"\nMobile Jabber client\n");
+ form.append(new StringItem(null, Version.BOMBUS_SITE_URL+"\n", Item.HYPERLINK));
+ //
form.append(Version.getOs());
form.append("\nCopyright (c) 2005-2008, Eugene Stahov (evgs),\n");
- form.append (new StringItem(null, Version.BOMBUS_SITE_URL
-//#if !(MIDP1)
- , Item.HYPERLINK
-//#endif
- ));
+ form.append(new StringItem(null, "http://bombus-im.org", Item.HYPERLINK)); //
- StringBuffer memInfo=new StringBuffer("\n\n");
- memInfo.append(SR.MS_MEMORY);
- memInfo.append("\n");
- memInfo.append(SR.MS_MEMORY_FREE);
- //mem.append(Runtime.getRuntime().freeMemory()>>10);
- //mem.append("\nFree=");
- System.gc();
- memInfo.append(Runtime.getRuntime().freeMemory()>>10);
- memInfo.append("\n");
- memInfo.append(SR.MS_MEMORY_TOTAL);
- memInfo.append(Runtime.getRuntime().totalMemory()>>10);
- form.append(memInfo.toString());
//#if ZLIB
- form.append("\n\n");
+ form.append("\n");
String conn_stats;
try {
conn_stats=StaticData.getInstance().roster.theStream.getStreamStats();
@@ -88,7 +75,17 @@
}
form.append(conn_stats);
//#endif
-
+
+ StringBuffer memInfo=new StringBuffer("\n Memory:\n");
+ memInfo.append("Free=");
+ //mem.append(Runtime.getRuntime().freeMemory()>>10);
+ //mem.append("\nFree=");
+ System.gc();
+ memInfo.append(Runtime.getRuntime().freeMemory()>>10);
+ memInfo.append("\nTotal=");
+ memInfo.append(Runtime.getRuntime().totalMemory()>>10);
+ form.append(memInfo.toString());
+
form.setCommandListener(this);
display.setCurrent(form);
}
Index: bombus-plus/export/trunk/src/Info/Version.java
===================================================================
--- bombus-plus/export/trunk/src/Info/Version.java (revision 1363)
+++ bombus-plus/export/trunk/src/Info/Version.java (working copy)
@@ -28,22 +28,26 @@
package Info;
import locale.SR;
-import ui.ConstMIDP;
+//import ui.ConstMIDP;
/**
*
* @author Evg_S
*/
public class Version {
-//#if (!ZLIB)
-//# public final static String version="$BOMBUSVERSION$";
+//#if (ReleaseJZLIB) || (ReleaseZH) || (ReleaseZVOFFK)
+//# public final static String version="$BOMBUSVERSION$-Zlib"; // || $BUILDDATE$";
+//# //public final static String version="0.7.1319.84M-Zlib"; // || $BUILDDATE$";
+//# //public final static String version="$BOMBUSVERSION$-Zlib (Bombus+ and Opera Mini 3 combine, http://voffk.org.ru/j2me/combines/ ); // || $BUILDDATE$";
+//#elif ReleaseZLITE
+//# public final static String version="$BOMBUSVERSION$-Zlib (Lite)"; // || $BUILDDATE$";
//#else
- public final static String version="$BOMBUSVERSION$-Zlib";
+ public final static String version="$BOMBUSVERSION$"; // || $BUILDDATE$";
//#endif
// this string will be patched by build.xml/post-preprocess
- public final static String NAME="Bombus";
- public final static String BOMBUS_SITE_URL="http://bombus-im.org";
+ public final static String NAME="Bombus+"; //
+ public final static String BOMBUS_SITE_URL="http://bombus.voffk.org.ru"; //
private static String platformName;
@@ -85,7 +89,7 @@
if (device==null) device=System.getProperty("funlights.product");
if (device!=null) platformName="Motorola-"+device;
String devicesoftware=System.getProperty("device.software.version");
- if (devicesoftware!=null) platformName=platformName+"//"+devicesoftware;
+ if (devicesoftware!=null) platformName=platformName+"/"+devicesoftware;
}
//#if (!MIDP1)
@@ -100,7 +104,7 @@
}
public static String getOs() {
- return ConstMIDP.MIDP + " Platform=" +Version.getPlatformName();
+ return "MIDP2 Platform=" +Version.getPlatformName(); //
}
public static String getNameVersion() { return NAME+" "+version; }
Index: bombus-plus/export/trunk/src/Info/Upgrade.java
===================================================================
--- bombus-plus/export/trunk/src/Info/Upgrade.java (revision 1363)
+++ bombus-plus/export/trunk/src/Info/Upgrade.java (working copy)
@@ -27,6 +27,7 @@
package Info;
+import java.io.IOException;
import java.io.InputStream;
import java.util.Hashtable;
import java.util.Vector;
@@ -48,9 +49,13 @@
private Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 99);
private Command cmdInstall=new Command(SR.MS_INSTALL, Command.ITEM, 1);
+ private Command cmdRefresh = new Command(SR.MS_REFRESH, Command.ITEM, 2);
private final static String VERSION_URL=Version.BOMBUS_SITE_URL+"/version.php";
List list;
Vector versions[];
+ //Integer
+ private HttpConnection c;
+ private InputStream is;
private Display display;
private Displayable parentView;
@@ -62,15 +67,17 @@
list=new List(SR.MS_AVAILABLE_VERSIONS, List.IMPLICIT);
list.setCommandListener(this);
list.addCommand(cmdBack);
+ list.addCommand(cmdRefresh);
display.setCurrent(list);
new Thread(this).start();
}
public void run() {
try {
- String vUrl=Client.Config.getInstance().getStringProperty("Bombus-Upgrade", VERSION_URL);
- HttpConnection c = (HttpConnection) Connector.open(vUrl);
- InputStream is = c.openInputStream();
+ /*String vUrl=Client.Config.getInstance().getStringProperty("Bombus-Upgrade", VERSION_URL);
+ HttpConnection c = (HttpConnection) Connector.open(vUrl);*/ //
+ c = (HttpConnection) Connector.open(VERSION_URL);
+ is = c.openInputStream();
versions=new util.StringLoader().stringLoader(is, 3);
@@ -99,6 +106,24 @@
} catch (Exception e) { e.printStackTrace(); }
}
+
+ if(command == cmdRefresh)// Integer
+ {
+ list.deleteAll();
+ try
+ {
+ is.close();
+ c.close();
+ }
+ catch(IOException e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ this.run();
+ }
+ }
}
private void destroyView() {
Index: bombus-plus/export/trunk/src/PrivacyLists/PrivacyForm.java
===================================================================
--- bombus-plus/export/trunk/src/PrivacyLists/PrivacyForm.java (revision 1363)
+++ bombus-plus/export/trunk/src/PrivacyLists/PrivacyForm.java (working copy)
@@ -30,8 +30,11 @@
import javax.microedition.lcdui.*;
import java.util.*;
import locale.SR;
-import ui.ConstMIDP;
+//import ui.ConstMIDP;
import ui.controls.TextFieldCombo;
+//#if CLIPBOARD
+//# import ui.controls.TextFieldEx;
+//#endif
/**
*
@@ -49,12 +52,12 @@
private PrivacyList targetList;
Form form=new Form(SR.MS_PRIVACY_RULE);
- ChoiceGroup choiceAction=new ChoiceGroup(SR.MS_PRIVACY_ACTION, ConstMIDP.CHOICE_POPUP, PrivacyItem.actions, null);
- ChoiceGroup choiseType=new ChoiceGroup(SR.MS_PRIVACY_TYPE, ConstMIDP.CHOICE_POPUP, PrivacyItem.types, null);
+ ChoiceGroup choiceAction=new ChoiceGroup(SR.MS_PRIVACY_ACTION, ChoiceGroup.POPUP, PrivacyItem.actions, null); //
+ ChoiceGroup choiseType=new ChoiceGroup(SR.MS_PRIVACY_TYPE, ChoiceGroup.POPUP, PrivacyItem.types, null); //
ChoiceGroup choiseStanzas=new ChoiceGroup(SR.MS_STANZAS, ChoiceGroup.MULTIPLE, PrivacyItem.stanzas, null);
TextField textValue;
//TextField textOrder;
- ChoiceGroup choiceSubscr=new ChoiceGroup(SR.MS_SUBSCRIPTION, ConstMIDP.CHOICE_POPUP, PrivacyItem.subscrs, null);
+ ChoiceGroup choiceSubscr=new ChoiceGroup(SR.MS_SUBSCRIPTION, ChoiceGroup.POPUP, PrivacyItem.subscrs, null); //
Command cmdCancel=new Command(SR.MS_CANCEL, Command.BACK, 99);
Command cmdOk=new Command(SR.MS_OK, Command.OK, 1);
@@ -65,7 +68,11 @@
this.item=item;
targetList=plist;
- textValue=new TextField(null, item.value, 64, ConstMIDP.TEXTFIELD_URL);
+//#if CLIPBOARD
+//# textValue=new TextFieldEx(null, item.value, 64, TextField.URL);
+//#else
+ textValue=new TextField(null, item.value, 64, TextField.URL); //
+//#endif
TextFieldCombo.setLowerCaseLatin(textValue);
form.append(choiceAction);
Index: bombus-plus/export/trunk/src/Mood/Moods.java
===================================================================
--- bombus-plus/export/trunk/src/Mood/Moods.java (revision 1363)
+++ bombus-plus/export/trunk/src/Mood/Moods.java (working copy)
@@ -44,7 +44,9 @@
if (vMood==null) vMood=new StringLoader().stringLoader("/lang/en.moods.txt", 2);
if (vMood==null) {
- System.out.println("Cant't load mood names");
+//#if DEBUG
+ System.out.println("Cant't load mood names"); //
+//#endif
moodKey=moodValue=new Vector();
} else {
moodKey=(Vector)vMood[0];
Index: bombus-plus/export/trunk/src/vcard/VCard.java
===================================================================
--- bombus-plus/export/trunk/src/vcard/VCard.java (revision 1363)
+++ bombus-plus/export/trunk/src/vcard/VCard.java (working copy)
@@ -31,7 +31,7 @@
import com.alsutton.jabber.datablocks.Iq;
import java.util.*;
import java.io.*;
-import javax.microedition.lcdui.Image;
+//import javax.microedition.lcdui.Image;
import util.StringLoader;
import util.strconv;
@@ -56,6 +56,8 @@
private boolean empty=true;
+ private String photoType=null; //
+
/** Creates a new instance of vCard */
public VCard() {
if (vCardFields==null) fieldsLoader();
@@ -91,9 +93,12 @@
}
try {
- JabberDataBlock photoXML=vcard.getChildBlock("PHOTO").getChildBlock("BINVAL");
- photo=(byte[])photoXML.getChildBlocks().lastElement();
- } catch (Exception e) {};
+ JabberDataBlock photoXML=vcard.getChildBlock("PHOTO");
+ try {
+ photoType=photoXML.getChildBlock("TYPE").getText();
+ } catch (Exception e) {}
+ photo=(byte[])photoXML.getChildBlock("BINVAL").getChildBlocks().lastElement();
+ } catch (Exception e) {}
}
public JabberDataBlock constructVCard(){
@@ -118,11 +123,10 @@
}
if (photo!=null) {
- String mime=getPhotoMIMEType();
- if (mime!=null) {
- JabberDataBlock ph=vcardTemp.addChild("PHOTO", null);
- ph.addChild("BINVAL", strconv.toBase64(photo, -1));
- ph.addChild("TYPE", mime);
+ JabberDataBlock ph=vcardTemp.addChild("PHOTO", null);
+ ph.addChild("BINVAL", strconv.toBase64(photo, -1));
+ if (photoType!=null) {
+ ph.addChild("TYPE", photoType);
}
}
//System.out.println(vcard.toString());
@@ -131,7 +135,7 @@
public byte[] getPhoto() { return photo; }
- public String getPhotoMIMEType() {
+ /*public String getPhotoMIMEType() {
try {
if (photo[0]==(byte)0xff &&
photo[1]==(byte)0xd8 &&
@@ -141,23 +145,23 @@
photo[9]==(byte)'F')
return "image/jpeg";
- if (photo[0]==(byte)0x89 &&
+ if (photo[0]==0x89 &&
photo[1]==(byte)'P' &&
photo[2]==(byte)'N' &&
photo[3]==(byte)'G')
return "image/png";
- if (photo[0]==(byte)'G' &&
- photo[1]==(byte)'I' &&
- photo[2]==(byte)'F')
+ if (photo[1]==(byte)'G' &&
+ photo[2]==(byte)'I' &&
+ photo[3]==(byte)'F')
return "image/gif";
- if (photo[0]==(byte)'B' &&
- photo[1]==(byte)'M')
+ if (photo[1]==(byte)'B' &&
+ photo[2]==(byte)'M')
return "image/x-ms-bmp";
} catch (Exception e) {}
return null;
- }
+ }*/ //moved to vCardForm
public void setPhoto(byte[] photo) {
this.photo=photo;
@@ -198,6 +202,10 @@
vCardData.setElementAt(data, index);
}
+ public void setPhotoType(String photoType) {
+ this.photoType=photoType;
+ }
+
public int getCount(){ return vCardFields.size(); }
public String getJid() { return jid; }
Index: bombus-plus/export/trunk/src/vcard/vCardForm.java
===================================================================
--- bombus-plus/export/trunk/src/vcard/vCardForm.java (revision 1363)
+++ bombus-plus/export/trunk/src/vcard/vCardForm.java (working copy)
@@ -36,14 +36,21 @@
import java.io.OutputStream;
//#endif
-//#if (!MIDP1)
import images.camera.*;
-//#endif
import java.util.*;
import javax.microedition.lcdui.*;
import locale.SR;
+//
+import ui.Time;
+import util.strconv;
+//#if CLIPBOARD
+//# import ui.controls.StringItemEx; //
+//# import ui.controls.TextFieldEx;
+//#endif
+//
+
/**
*
* @author EvgS
@@ -53,10 +60,7 @@
//#if (FILE_IO)
, BrowserListener
//#endif
-
-//#if (!MIDP1)
, CameraImageListener
-//#endif
{
private Display display;
@@ -65,9 +69,13 @@
protected Command cmdCancel=new Command(SR.MS_CANCEL, Command.BACK, 99);
protected Command cmdPublish=new Command(SR.MS_PUBLISH, Command.OK /*Command.SCREEN*/, 1);
protected Command cmdRefresh=new Command(SR.MS_REFRESH, Command.SCREEN, 2);
- protected Command cmdPhoto=new Command(SR.MS_LOAD_PHOTO, Command.SCREEN,3);
- protected Command cmdDelPhoto=new Command(SR.MS_CLEAR_PHOTO, Command.SCREEN,4);
- protected Command cmdCamera=new Command(SR.MS_CAMERA, Command.SCREEN,5);
+//#if (FILE_IO)
+ protected Command cmdLoadPhoto=new Command(SR.MS_LOAD_PHOTO, Command.SCREEN,3);
+ protected Command cmdSavePhoto=new Command(SR.MS_SAVE_PHOTO, Command.SCREEN,4);
+//#endif
+ protected Command cmdDelPhoto=new Command(SR.MS_CLEAR_PHOTO, Command.SCREEN,5);
+ protected Command cmdCamera=new Command(SR.MS_CAMERA, Command.SCREEN,6);
+ protected Command cmdDelViewedPhoto = new Command(SR.MS_CLEAR_PHOTO, Command.SCREEN, 7);
private Form f;
private Vector items=new Vector();
@@ -75,6 +83,15 @@
private byte[] photo;
private int photoIndex;
+ //
+ private String photoType=null;
+ private int st=-1;
+//#if FILE_IO
+ private int filePos;
+ private FileIO file;
+ private OutputStream os;
+//#endif
+ //
/** Creates a new instance of vCardForm */
public vCardForm(Display display, VCard vcard, boolean editable) {
@@ -86,6 +103,17 @@
f=new Form(SR.MS_VCARD);
f.append(vcard.getJid());
+ //
+ if (vcard.isEmpty() && !editable)
+ f.append("\n[no vCard available]");
+ else {
+ photoIndex=f.append("[]");
+
+ photo=vcard.getPhoto();
+ setPhoto();
+ }
+ //
+
for (int index=0; index";
}
- item=new TextField(name, data, 500, TextField.ANY);
+//#if CLIPBOARD
+//# item=new TextFieldEx(name, data, 500, TextField.ANY);//TextFieldEx - for clipboard
+//# items.addElement(item);
+//# } else if (data!=null) {
+//# item=new StringItemEx(name, data);
+//#else
+ item=new TextField(name, data, 500, TextField.ANY);//TextFieldEx - for clipboard
items.addElement(item);
} else if (data!=null) {
item=new StringItem (name, data);
+//#endif
}
if (item!=null) {
f.append(item);
-//#if !(MIDP1)
f.append(new Spacer(256, 3));
-//#else
-//# f.append("\n");
-//#endif
}
}
- if (vcard.isEmpty() && !editable)
+ //
+ f.append("\n[end of vCard]");
+ /*if (vcard.isEmpty() && !editable)
f.append("\n[no vCard available]");
else {
photoIndex=f.append("[]");
@@ -123,7 +156,8 @@
f.append("\n\n[end of vCard]");
- }
+ }*/ //moved up
+ //
f.addCommand(cmdCancel);
@@ -131,15 +165,21 @@
if (editable) {
f.addCommand(cmdPublish);
//#if (FILE_IO)
- f.addCommand(cmdPhoto);
+ f.addCommand(cmdLoadPhoto);
//#endif
-//#if !(MIDP1)
String cameraAvailable=System.getProperty("supports.video.capture");
if (cameraAvailable!=null) if (cameraAvailable.startsWith("true"))
f.addCommand(cmdCamera);
-//#endif
f.addCommand(cmdDelPhoto);
}
+ //
+ if (!editable && photo!=null) {
+ f.addCommand(cmdDelViewedPhoto);
+//#if (FILE_IO)
+ f.addCommand(cmdSavePhoto);
+//#endif
+ }
+ //
f.setCommandListener(this);
display.setCurrent(f);
}
@@ -150,17 +190,25 @@
VCard.request(vcard.getJid(), vcard.getId().substring(5));
destroyView();
}
-
+ //
+ if (c==cmdDelViewedPhoto) {
+ vcard.photo=null;
+ destroyView();
+ }
+ //
//#if (FILE_IO)
- if (c==cmdPhoto) {
+ if (c==cmdLoadPhoto) {
+ st=1;
new Browser(null, display, this, false);
}
+ if (c==cmdSavePhoto) {
+ st=2;
+ new Browser(null, display, this, true);
+ }
//#endif
-//#if (!MIDP1)
if (c==cmdCamera)
new CameraImage(display, this);
-//#endif
if (c==cmdDelPhoto) {
photo=null;
@@ -170,7 +218,7 @@
if (c!=cmdPublish) return;
vcard.setPhoto(photo);
-
+ vcard.setPhotoType(getPhotoMIMEType());
for (int index=0; index0) {
+ if (st==1) {
+ try {
+ FileIO f=FileIO.createConnection(pathSelected);
+ InputStream is=f.openInputStream();
+ byte[] b=new byte[(int)f.fileSize()];
+ is.read(b);
+ is.close();
+ f.close();
+ photo=b;
+ vcard.setPhotoType(getPhotoMIMEType());
+ //System.out.println(getPhotoMIMEType());
+ setPhoto();
+ } catch (Exception e) {e.printStackTrace();}
+ }
+ if (st==2 & photo!=null) {
+ //System.out.println(photoType+"->"+getFileType(photoType));
+ String filename = strconv.replaceBadChars(getNickDate());
+ file=FileIO.createConnection(pathSelected+filename+getFileType( getPhotoMIMEType() ));
+ try {
+ os=file.openOutputStream();
+ writeFile(photo);
+ os.close();
+ file.close();
+ } catch (IOException ex) {
+ try {
+ file.close();
+ } catch (IOException ex2) { }
+ }
+ }
+ }
+ }
+
+ void writeFile(byte b[]){
try {
- FileIO f=FileIO.createConnection(pathSelected);
- InputStream is=f.openInputStream();
- byte[] b=new byte[(int)f.fileSize()];
- is.read(b);
- is.close();
- f.close();
- photo=b;
- setPhoto();
- } catch (Exception e) {e.printStackTrace();}
+ os.write(b);
+ filePos+=b.length;
+ } catch (IOException ex) { }
}
+
+ private String getNickDate() {
+ StringBuffer nickDate=new StringBuffer();
+ nickDate.append("vCard_");
+ if (vcard.getNickName()!=null) {
+ nickDate.append(vcard.getNickName());
+ } else nickDate.append(vcard.getJid());
+ nickDate.append("_");
+ nickDate.append(Time.localDate());
+ return nickDate.toString();
+ }
+
+ private String getFileType(String MIMEtype) {
+ if (MIMEtype!=null) {
+ if (MIMEtype=="image/jpeg") return ".jpg";
+ if (MIMEtype=="image/png") return ".png";
+ if (MIMEtype=="image/gif") return ".gif";
+ if (MIMEtype=="image/x-ms-bmp") return ".bmp";
+ }
+ return ".jpg";
+ }
//#endif
-//#if (!MIDP1)
public void cameraImageNotify(byte[] capturedPhoto) {
photo=capturedPhoto;
setPhoto();
}
-//#endif
private void setPhoto() {
-
Item photoItem=new StringItem(null, "[no photo available]");
if (photo!=null) {
-//#if !(MIDP1)
String size=String.valueOf(photo.length)+" bytes";
try {
Image photoImg=Image.createImage(photo, 0, photo.length);
photoItem=new ImageItem(size, photoImg, 0, null);
} catch (Exception e) { photoItem=new StringItem(size, "[Unsupported format]"); }
-//#endif
}
f.set(photoIndex, photoItem);
}
-
-}
+
+ public String getPhotoMIMEType() {
+ try {
+ if (photo[0]==(byte)0xff &&
+ photo[1]==(byte)0xd8 &&
+ (photo[6]==(byte)'J' || photo[6]==(byte)'E' || photo[6]==(byte)'e') &&
+ (photo[7]==(byte)'F' || photo[7]==(byte)'x' || photo[7]==(byte)'X') &&
+ (photo[8]==(byte)'I' || photo[8]==(byte)'i') &&
+ (photo[9]==(byte)'F' || photo[9]==(byte)'f')) {
+ //System.out.println("image/jpeg");
+ return "image/jpeg";
+ }
+
+ if (photo[0]==(byte)0x89 &&
+ photo[1]==(byte)'P' &&
+ photo[2]==(byte)'N' &&
+ photo[3]==(byte)'G') {
+ //System.out.println("image/png");
+ return "image/png";
+ }
+
+ if (photo[0]==(byte)'G' &&
+ photo[1]==(byte)'I' &&
+ photo[2]==(byte)'F') {
+ //System.out.println("image/gif");
+ return "image/gif";
+ }
+
+ if (photo[0]==(byte)'B' &&
+ photo[1]==(byte)'M') {
+ //System.out.println("image/x-ms-bmp");
+ return "image/x-ms-bmp";
+ }
+
+ } catch (Exception e) {}
+ //System.out.println("unknown MIME type");
+ return null;
+ }
+}
\ No newline at end of file
Index: bombus-plus/export/trunk/src/locale/SR.java
===================================================================
--- bombus-plus/export/trunk/src/locale/SR.java (revision 1363)
+++ bombus-plus/export/trunk/src/locale/SR.java (working copy)
@@ -28,20 +28,24 @@
package locale;
+import java.util.Hashtable;
+
+//#if (!ReleaseZLITE)
import Client.Config;
-import java.util.Hashtable;
-import javax.microedition.lcdui.Item;
+//import javax.microedition.lcdui.Item;
import util.StringLoader;
+//#endif
public class SR {
-
+ public final static String MS_SLASHME = "/me";
+//#if (!ReleaseZLITE)
public static String MS_JID = loadString( "Jid" );
public static String MS_PRIVACY_LISTS = loadString( "Privacy Lists" );
public static String MS_MESSAGE_FONT = loadString( "Message font" );
public static String MS_ROSTER_FONT = loadString( "Roster font" );
- public static String MS_PASTE_BODY = loadString( "Paste Body" );
+ //public static String MS_PASTE_BODY = loadString( "Paste Body" ); <1>
public static String MS_CONFIG_ROOM = loadString( "Configure Room" );
- public static String MS_PASTE_SUBJECT = loadString( "Paste Subject" );
+ //public static String MS_PASTE_SUBJECT = loadString( "Paste Subject" ); <1>
public static String MS_DISCO = loadString( "Service Discovery" );
public static String MS_USER_JID = loadString( "User JID" );
public static String MS_NEW_LIST = loadString( "New list" );
@@ -51,8 +55,11 @@
public static String MS_MODIFY = loadString( "Modify" );
public static String MS_UPDATE = loadString( "Update" );
public static String MS_ACCOUNT_NAME = loadString( "Account name" );
- public static String MS_GMT_OFFSET = loadString( "GMT offset" );
- public static String MS_TIME_SETTINGS = loadString( "Time settings (hours)" );
+ public static String MS_GMT_OFFSET = loadString( "GMT offset, hours" ); //
+
+ public static String MS_CLOCK_OFFSET = loadString( "Clock offset, hours" ); //
+
+ //public static String MS_TIME_SETTINGS = loadString( "Time settings (hours)" );
public static String MS_CONNECTED = loadString( "Connected" );
public static String MS_CONNECT_TO = loadString( "Connect to " );
public static String MS_ALERT_PROFILE = loadString( "Alert Profile" );
@@ -74,7 +81,6 @@
public static String MS_ACCOUNTS = loadString( "Accounts" );
public static String MS_DELETE_LIST = loadString( "Delete list" );
public static String MS_ACCOUNT_= loadString( "Account >" );
- //public static String MS_SHOWOFFLINES = loadString( "Show Offlines" );
public static String MS_SELECT = loadString( "Select" );
public static String MS_SUBJECT = loadString( "Subject" );
public static String MS_GROUP_MENU = loadString( "Group menu" );
@@ -118,7 +124,6 @@
public static String MS_DELETE_ASK = loadString( "Delete contact?" );
public static String MS_SUBSCRIBE = loadString( "Authorize" );
public static String MS_NICKNAMES = loadString( "Nicknames" );
- //public static String MS_ENT_SETUP = loadString( "Entering setup" );
public static String MS_ADD_ARCHIVE = loadString( "to Archive" );
public static String MS_BACK = loadString( "Back" );
public static String MS_HEAP_MONITOR = loadString( "heap monitor" );
@@ -139,16 +144,16 @@
public static String MS_AT_HOST = loadString( "at Host" );
public static String MS_AUTO_CONFERENCES = loadString( "join conferences" );
public static String MS_STATUS = loadString( "Status" );
- public static String MS_SMILES_TOGGLE = loadString( "Smiles" );
+ //public static String MS_SMILES_TOGGLE = loadString( "Smiles" );
public static String MS_CONTACT = loadString( "Contact >" );
- public final static String MS_SLASHME = "/me";
+ //public final static String MS_SLASHME = "/me"; //moved higher
public static String MS_OFFLINE_CONTACTS = loadString( "offline contacts" );
public static String MS_TRANSPORT = loadString( "Transport" );
public static String MS_COMPOSING_EVENTS = loadString( "composing events" );
public static String MS_ADD_SMILE = loadString( "Add Smile" );
public static String MS_NICKNAME = loadString( "Nickname" );
public static String MS_REVOKE_VOICE = loadString( "Revoke Voice" );
- public static String MS_NOT_IN_LIST = loadString( "Not-in-list" );
+ //public static String MS_NOT_IN_LIST = loadString( "Not-in-list" );
public static String MS_COMMANDS = loadString( "Commands" );
public static String MS_CHSIGN = loadString( "- (Sign)" );
public static String MS_SETDEFAULT = loadString( "Set default" );
@@ -168,7 +173,7 @@
public static String MS_CANCEL = loadString( "Cancel" );
public static String MS_CLOSE = loadString( "Close" );
public static String MS_ARCHIVE = loadString( "Archive" );
- public static String MS_FREE = loadString( "free " );
+ //public static String MS_FREE = loadString( "free " );
public static String MS_CONFERENCE = loadString( "Conference" );
public static String MS_SOUND = loadString( "Sound" );
public static String MS_LOGIN_FAILED = loadString( "Login failed" );
@@ -193,7 +198,7 @@
public static String MS_ALL_STATUSES = loadString( "for all status types" );
public static String MS_PASTE_JID = loadString( "Paste Jid" );
public static String MS_GOTO_URL = loadString( "Goto URL" );
- public static String MS_CLOCK_OFFSET = loadString( "Clock offset" );
+
public static String MS_YES = loadString( "Yes" );
public static String MS_FLASHBACKLIGHT = loadString( "flash backlight" );
public static String MS_SUSPEND = loadString( "Suspend" );
@@ -201,29 +206,26 @@
public static String MS_MY_VCARD = loadString( "My vCard" );
public static String MS_TRANSPORTS = loadString( "transports" );
public static String MS_NEW_ACCOUNT = loadString( "New Account" );
- public static String MS_SELF_CONTACT = loadString( "self-contact" );
+ //public static String MS_SELF_CONTACT = loadString( "self-contact" );
public static String MS_VCARD = loadString( "vCard" );
public static String MS_SET_SUBJECT = loadString( "Set Subject" );
public static String MS_TOOLS = loadString( "Tools" );
//public static String MS_JABBER_TOOLS = loadString( "Jabber Tools" ); //replaced by "Tools"
public static String MS_PORT = loadString( "Port" );
public static String MS_RESUME = loadString( "Resume Message" );
- //public static String MS_PROXY_ENABLE = loadString( "proxy CONNECT" );
- //public static String MS_PROXY_HOST = loadString( "Proxy name/IP" );
- //public static String MS_PROXY_PORT = loadString( "Proxy port" );
public static String MS_ARE_YOU_SURE_WANT_TO_DISCARD = loadString( "Are You sure want to discard " );
public static String MS_FROM_OWNER_TO = loadString( " from OWNER to " );
public static String MS_MODIFY_AFFILIATION = loadString( "Modify affiliation" );
//public static String MS_ADD_TO_ROSTER = loadString( "Add to roster" ); //not used in 1197 there are fs#464 ;-) (string don't deleted in locales)
public static String MS_CLEAR=loadString( "Clear" );
public static String MS_SELLOGIN = loadString( "Connect" );
-//--toon
+//toon
public static String MS_UNAFFILIATE = loadString("Unaffiliate");
public static String MS_GRANT_MODERATOR = loadString("Grant Moderator");
public static String MS_REVOKE_MODERATOR = loadString("Revoke Moderator");
public static String MS_GRANT_ADMIN = loadString("Grant Admin");
public static String MS_GRANT_OWNERSHIP = loadString("Grant Ownership");
-//--toon
+//toon
public static String MS_VIZITORS_FORBIDDEN=loadString("Visitors are not allowed to send messages to all occupants");
public static String MS_IS_INVITING_YOU=loadString(" is inviting You to ");
@@ -241,15 +243,15 @@
public static String MS_WAS_BANNED=loadString(" was banned ");
public static String MS_WAS_KICKED=loadString(" was kicked ");
public static String MS_HAS_BEEN_KICKED_BECAUSE_ROOM_BECAME_MEMBERS_ONLY=loadString(" has been kicked because room became members-only");
- public static String MS_HAS_LEFT_CHANNEL=loadString(" has left the channel");
- public static String MS_HAS_JOINED_THE_CHANNEL_AS=loadString(" has joined the channel as ");
+ public static String MS_HAS_LEFT_THE_ROOM=loadString(" has left the room");
+ public static String MS_HAS_JOINED_THE_ROOM_AS=loadString(" has joined the room as ");
public static String MS_AND=loadString(" and ");
public static String MS_IS_NOW=loadString(" is now ");
//2007-04-11
public static String MS_AUTOFOCUS = loadString( "autofocus" );
public static String MS_GRANT_MEMBERSHIP = loadString( "Grant Membership" );
- public static String MS_SURE_CLEAR = loadString( "Are You sure want to clear messagelist?" );
+ public static String MS_SURE_CLEAR = loadString( "Delete the messages above the cursor?" );
public static String MS_TOKEN = loadString( "Google token request" );
@@ -270,7 +272,7 @@
public static String MS_DIRECT_PRESENCE = loadString( "Send status" );
public static String MS_CONFIRM_BAN = loadString( "Are you sure want to BAN this person?" );
- public static String MS_NO_REASON = loadString( "No reason" );
+ //public static String MS_NO_REASON = loadString( "No reason" );
public static String MS_RECENT = loadString( "Recent" );
public static String MS_CAMERASHOT = loadString( "Shot" );
public static String MS_SELECT_FILE = loadString( "Select file" );
@@ -283,7 +285,7 @@
public static String MS_NEW_BOOKMARK = loadString( "New conference" );
public static String MS_ROOT = loadString( "Root" );
public static String MS_DECLINE = loadString( "Decline" );
- public static String MS_AUTH_NEW = loadString( "Authorize new contacts" );
+ public static String MS_AUTH_NEW = loadString( "authorize new contacts" );//
public static String MS_AUTH_AUTO = loadString( "[auto-subscribe]" );
public static String MS_KEEPALIVE = loadString( "Keep-Alive" );
public static String MS_HAS_BEEN_UNAFFILIATED_AND_KICKED_FROM_MEMBERS_ONLY_ROOM = loadString( " has been unaffiliated and kicked from members-only room" );
@@ -310,21 +312,17 @@
public static String MS_SHOW_HARDWARE = loadString( "shared platform info" );
public static String MS_DELIVERY = loadString( "delivery events" );
- public static String MS_NIL_DROP_MP = loadString( "drop all" );
- public static String MS_NIL_DROP_P = loadString( "receive messages" );
- public static String MS_NIL_ALLOW_ALL = loadString( "messages & presences" );
public static String MS_FONTSIZE_NORMAL = loadString( "normal" );
public static String MS_FONTSIZE_SMALL = loadString( "small" );
public static String MS_FONTSIZE_LARGE = loadString( "large" );
public static String MS_FILE_TRANSFERS = loadString( "File Transfers" );
- public static String MS_ALERT_PROFILE_AUTO = loadString( "Auto" );
+ /*public static String MS_ALERT_PROFILE_AUTO = loadString( "Auto" );
public static String MS_ALERT_PROFILE_ALLSIGNALS = loadString( "All signals" );
public static String MS_ALERT_PROFILE_VIBRA = loadString( "Vibra" );
- //public static String MS_ALERT_PROFILE_SOUND = loadString( "Sound" );
+ public static String MS_ALERT_PROFILE_SOUND = loadString( "Sound" );
public static String MS_ALERT_PROFILE_NOSIGNALS = loadString( "No signals" );
- public static String MS_IS_DEFAULT = loadString( " (default)" );
+ public static String MS_ALERT_PROFILE_DEFAULT = loadString( " (default)" );*/ //
-//2007-10-24 voffk
public static String MS_MESSAGE_COLLAPSE_LIMIT = loadString ( "Message collapse limit" );
public static String MS_SUBSCRIPTION_REQUEST_FROM_USER = loadString ( "This user wants to subscribe to your presence" );
public static String MS_SUBSCRIPTION_RECEIVED = loadString ( "You are now authorized" );
@@ -340,44 +338,340 @@
public static String MS_SAVE_TO = loadString( "Save to" );
public static String MS_SENDER = loadString( "Sender:" );
public static String MS_FILE_SIZE = loadString( "size:" );
-
-
-//2007-11-04
- public static String MS_SUBSCR_AUTO=loadString("Automatic subscription");
- public static String MS_SUBSCR_ASK=loadString("Ask me");
- public static String MS_SUBSCR_DROP=loadString("Drop subscription");
- public static String MS_SUBSCR_REJECT=loadString("Deny subscription"); //TODO: correct according to RFC
-
-//2007-11-07
- public static String MS_SEARCH=loadString("Search");
- public static String MS_REGISTER=loadString("Register");
-
+////
public static String MS_COLOR_THEME=loadString("Color theme");
- public static String MS_MEMORY=loadString( "Memory:" );
- public static String MS_MEMORY_FREE=loadString( "Free=" );
- public static String MS_MEMORY_TOTAL=loadString( "Total=" );
public static String MS_VERSIONS=loadString( "Versions" );
public static String MS_INSTALL=loadString( "Install" );
public static String MS_AVAILABLE_VERSIONS=loadString( "Available versions" );
-
-//2008-01-16
public static String MS_USER = loadString( "User" );
- public static String MS_XMLLANG;
- public static String MS_IFACELANG;
-
-//2008-05-04
- public static String MS_NO_COMPRESSION = loadString( "No compression" );
-
public static String MS_NEW_ROOM_CREATED = loadString( "New room created" );
-
public static String MS_LOAD_ROOMLIST = loadString( "Browse rooms");
+ //public static String MS_PEP = loadString( "Personal events");
- public static String MS_PEP = loadString( "Personal events");
-
public static String MS_USERMOOD = loadString( "User Mood");
public static String MS_PEP_NOT_SUPPORTED = loadString("Personal events not supported");
+//
+//#if NONSASL_ENABLE
+//# public static String MS_SASL = loadString( "SASL login" );
+//#else
+ public static String MS_NO_COMPRESSION = loadString( "no compression" );
+//#endif
+ public static String MS_PASTE = loadString( "Paste" );
+ public static String MS_UNSUBSCRIBE_FROM_PRESENCES = loadString( "Unsubscribe from presences" );
+ public static String MS_LAST_APPEARED_CONTACTS = loadString( "last appeared contacts" );
+ public static String MS_SAVE_PHOTO = loadString( "Save photo to ..." );
+ public static String MS_PREVIOUS_STATUS = loadString( "Previous status" );
+ public static String MS_IDLE = loadString( "Idle" );
+ public static String MS_TIME = loadString( "Time" );
+ public static String MS_SOUND_VOLUME = loadString( "Sound volume" );
+ public static String MS_MAX_RECONNECT = loadString( "Reconnects count" );
+ public static String MS_ACCOUNT_SELECT = loadString( "list of accounts" );
+ public static String MS_AUTOSCROLL = loadString( "auto-scrolling" );
+ public static String MS_SAVE = loadString( "Save" );
+//#if ARCHIVE_ADVANCED
+ public static String MS_MAKE_BACKUP = loadString( "Save to dir ..." );
+ public static String MS_IMPORT_FROM_BACKUP = loadString( "Import from file" );
+//#endif
+ public static String MS_EMULATE_TABS = loadString( "emulate tabs" );
+//#if PEP
+ public static String MS_MOOD = loadString( "enable moods");
+ //#if PEP_TUNE
+ public static String MS_TUNE = loadString( "enable tunes");
+ //#endif
+//#endif
+//#if CLIPBOARD
+//# public static String MS_CLIPBOARD = loadString( "clipboard" );
+//# public static String MS_COPY = loadString( "Copy" );
+//# public static String MS_SEND_CLIPBOARD = loadString( "Send clipboard" );
+//#endif
+ public static String MS_CONFIRM_DELETE_MESSAGES = loadString( "confirmation for deleting messages" );
+//#if TRAFFIC
+//# public static String MS_TRAFFIC_COUNTER = loadString( "counter of traffic" );
+//#endif
+//#if CHANGE_TRANSPORT
+//# public static String MS_REPLACE_TRANSPORT = loadString( "Replace transport" );
+//#endif
+
+ /*public static String MS_NIL_DROP_MP = loadString( "drop all" );
+ public static String MS_NIL_DROP_P = loadString( "receive messages" );
+ public static String MS_NIL_ALLOW_ALL = loadString( "messages & presences" ); */ //
+
+//#else
+//# public final static String MS_JID = "Jid";
+//# public final static String MS_LOADING = "";
+//# public final static String MS_PRIVACY_LISTS = " ";
+//# public final static String MS_MESSAGE_FONT = " ";
+//# public final static String MS_ROSTER_FONT = " ";
+//# public final static String MS_CONFIG_ROOM = " ";
+//# public final static String MS_DISCO = " ";
+//# public final static String MS_USER_JID = "JID ";
+//# public final static String MS_NEW_LIST = " ";
+//# public final static String MS_NOLOGIN = " ( )";
+//# public final static String MS_PRIVACY_RULE = " ";
+//# public final static String MS_SSL = " SSL";
+//# public final static String MS_MODIFY = "";
+//# public final static String MS_UPDATE = "";
+//# public final static String MS_ACCOUNT_NAME = " ";
+//# public final static String MS_GMT_OFFSET = " (GMTxx)";
+//#
+//# public final static String MS_CLOCK_OFFSET = ". , ";
+//#
+//# public final static String MS_CONNECTED = " ";
+//# public final static String MS_CONNECT_TO = " ";
+//# public final static String MS_ALERT_PROFILE = "";
+//# public final static String MS_MOVE_UP = " ";
+//# public final static String MS_OWNERS = "";
+//# public final static String MS_OK = "";
+//# public final static String MS_APP_MINIMIZE = "";
+//# public final static String MS_ROOM = "";
+//# public final static String MS_MESSAGES = "";
+//# public final static String MS_REFRESH = "";
+//# public final static String MS_RESOLVE_NICKNAMES = " ";
+//# public final static String MS_PRIVACY_ACTION = "";
+//# public final static String MS_BAN = " (ban)";
+//# public final static String MS_LEAVE_ROOM = " ";
+//# public final static String MS_PASSWORD = "";
+//# public final static String MS_ITEM_ACTIONS = " >";
+//# public final static String MS_ACTIVATE = "";
+//# public final static String MS_AFFILIATION = "";
+//# public final static String MS_ACCOUNTS = "";
+//# public final static String MS_DELETE_LIST = " ";
+//# public final static String MS_ACCOUNT_ = " >";
+//# public final static String MS_SELECT = "";
+//# public final static String MS_SUBJECT = "";
+//# public final static String MS_GROUP_MENU = " ";
+//# public final static String MS_APP_QUIT = "";
+//# public final static String MS_ROSTERADD = " ";
+//# public final static String MS_EDIT_LIST = " ";
+//# public final static String MS_REGISTERING = "";
+//# public final static String MS_DONE = "";
+//# public final static String MS_ERROR_ = ": ";
+//# public final static String MS_BROWSE = "";
+//# public final static String MS_SAVE_LIST = " ";
+//# public final static String MS_KEEPALIVE_PERIOD = " Keep-Alive";
+//# public final static String MS_NEWGROUP = "< >";
+//# public final static String MS_SEND = "";
+//# public final static String MS_PRIORITY = "";
+//# public final static String MS_FAILED = " ";
+//# public final static String MS_SET_PRIORITY = " ";
+//# public final static String MS_DELETE_RULE = " ";
+//# public final static String MS_IGNORE_LIST = "Ignore-List";
+//# public final static String MS_ROSTER_REQUEST = " ";
+//# public final static String MS_PRIVACY_TYPE = "";
+//# public final static String MS_NAME = "";
+//# public final static String MS_USERNAME = " ";
+//# public final static String MS_FULLSCREEN = "";
+//# public final static String MS_ALL_PRIORITIES = " ";
+//# public final static String MS_ADD_BOOKMARK = ". ";
+//# public final static String MS_CONFERENCES_ONLY = " ";
+//# public final static String MS_CLIENT_INFO = " ";
+//# public final static String MS_DISCARD = " ";
+//# public final static String MS_SEARCH_RESULTS = " ";
+//# public final static String MS_GENERAL = "General";
+//# public final static String MS_MEMBERS = "";
+//# public final static String MS_ADD_CONTACT = " ";
+//# public final static String MS_SUBSCRIPTION = "";
+//# public final static String MS_STATUS_MENU = " >";
+//# public final static String MS_JOIN = "";
+//# public final static String MS_STARTUP_ACTIONS = " ";
+//# public final static String MS_SERVER = "";
+//# public final static String MS_ADMINS = "";
+//# public final static String MS_MK_ILIST = " Ignore-List";
+//# public final static String MS_OPTIONS = "";
+//# public final static String MS_DELETE = "";
+//# public final static String MS_DELETE_ASK = " ?";
+//# public final static String MS_SUBSCRIBE = "";
+//# public final static String MS_NICKNAMES = " ";
+//# public final static String MS_ENT_SETUP = " ";
+//# public final static String MS_ADD_ARCHIVE = " ";
+//# public final static String MS_BACK = "";
+//# public final static String MS_MESSAGE = "";
+//# public final static String MS_OTHER = "<>";
+//# public final static String MS_HISTORY = " -";
+//# public final static String MS_APPEND = "";
+//# public final static String MS_ACTIVE_CONTACTS = ". ";
+//# public final static String MS_SELECT_NICKNAME = " ";
+//# public final static String MS_GROUP = "";
+//# public final static String MS_JOIN_CONFERENCE = " ";
+//# public final static String MS_NO = "";
+//# public final static String MS_REENTER = " ";
+//# public final static String MS_NEW_MESSAGE = " ";
+//# public final static String MS_ADD = "";
+//# public final static String MS_LOGON = "";
+//# public final static String MS_LOGINPGS = " ";
+//# public final static String MS_STANZAS = "Stanzas";
+//# public final static String MS_AT_HOST = "";
+//# public final static String MS_AUTO_CONFERENCES = " ";
+//# public final static String MS_STATUS = "";
+//# //public final static String MS_SMILES_TOGGLE = "/ ";
+//# public final static String MS_CONTACT = " >";
+//# public final static String MS_ORDER = "";
+//# public final static String MS_OFFLINE_CONTACTS = " ";
+//# public final static String MS_TRANSPORT = "";
+//# public final static String MS_COMPOSING_EVENTS = ". ";
+//# public final static String MS_ADD_SMILE = "";
+//# public final static String MS_NICKNAME = "";
+//# public final static String MS_REVOKE_VOICE = " ";
+//# public final static String MS_COMMANDS = "";
+//# public final static String MS_CHSIGN = "- ()";
+//# public final static String MS_SETDEFAULT = ". ";
+//# public final static String MS_BANNED = "";
+//# public final static String MS_SET_AFFILIATION = " ";
+//# public final static String MS_HIDE_OFFLINES = " ";
+//# public final static String MS_REGISTER_ACCOUNT = " ";
+//# public final static String MS_AUTOLOGIN = "";
+//# public final static String MS_LOGOFF = "";
+//# public final static String MS_PUBLISH = "";
+//# public final static String MS_SUBSCR_REMOVE = " ";
+//# public final static String MS_SET = "";
+//# public final static String MS_APPLICATION = "";
+//# public final static String MS_BOOKMARKS = "";
+//# public final static String MS_TEST_SOUND = " ";
+//# public final static String MS_STARTUP = "";
+//# public final static String MS_EDIT_RULE = " ";
+//# public final static String MS_CANCEL = "";
+//# public final static String MS_CLOSE = "";
+//# public final static String MS_ARCHIVE = "";
+//# public final static String MS_FREE = " ";
+//# public final static String MS_CONFERENCE = "";
+//# public final static String MS_SOUND = "";
+//# public final static String MS_LOGIN_FAILED = " ";
+//# public final static String MS_DISCOVER = "";
+//# public final static String MS_NEW_JID = " Jid";
+//# public final static String MS_PLAIN_PWD = " . ";
+//# public final static String MS_PASTE_NICKNAME = " ";
+//# public final static String MS_KICK = " (kick)";
+//# public final static String MS_CLEAR_LIST = " ";
+//# public final static String MS_GRANT_VOICE = " ";
+//# public final static String MS_MOVE_DOWN = " ";
+//# public final static String MS_QUOTE = "";
+//# public final static String MS_ROSTER_ELEMENTS = " ";
+//# public final static String MS_ENABLE_POPUP = " ";
+//# public final static String MS_SMILES = "";
+//# public final static String MS_ABOUT = " ";
+//# public final static String MS_RESOURCE = "";
+//# public final static String MS_DISCONNECTED = " ";
+//# public final static String MS_EDIT = "";
+//# public final static String MS_HOST_IP = " /IP ()";
+//# public final static String MS_ADD_RULE = " ";
+//# public final static String MS_ALL_STATUSES = " ";
+//# public final static String MS_PASTE_JID = " Jid";
+//# public final static String MS_GOTO_URL = " URL";
+//# public final static String MS_CLOCK = " -";
+//# public final static String MS_LOGIN = " ";
+//#
+//# public final static String MS_YES = "";
+//# public final static String MS_FLASHBACKLIGHT = " ";
+//# public final static String MS_SUSPEND = "";
+//# public final static String MS_ALERT_PROFILE_CMD = " >";
+//# public final static String MS_MY_VCARD = " vCard";
+//# public final static String MS_NEW_ACCOUNT = " ";
+//# public final static String MS_VCARD = "vCard";
+//# public final static String MS_SET_SUBJECT = " ";
+//# public final static String MS_TOOLS = "";
+//# public final static String MS_PORT = "";
+//# public final static String MS_RESUME = "";
+//# public final static String MS_PROXY_ENABLE = "proxy CONNECT";
+//# public final static String MS_PROXY_HOST = " -/IP";
+//# public final static String PROXY_PORT = " -";
+//# public final static String MS_ARE_YOU_SURE_WANT_TO_DISCARD = " ";
+//# public final static String MS_FROM_OWNER_TO = " OWNER ";
+//# public final static String MS_MODIFY_AFFILIATION = " ";
+//# public final static String MS_ADD_TO_ROSTER = " ";
+//# public final static String MS_CLEAR = "";
+//# public final static String MS_SELLOGIN = "";
+//# public final static String MS_UNAFFILIATE = " ";
+//# public final static String MS_GRANT_MODERATOR = " ";
+//# public final static String MS_REVOKE_MODERATOR = " ";
+//# public final static String MS_GRANT_ADMIN = " ";
+//# public final static String MS_GRANT_OWNERSHIP = " ";
+//# public final static String MS_VIZITORS_FORBIDDEN = " ";
+//# public final static String MS_IS_INVITING_YOU = " ";
+//# public final static String MS_ASK_SUBSCRIPTION = " ";
+//# public final static String MS_GRANT_SUBSCRIPTION = " ";
+//# public final static String MS_INVITE = " ";
+//# public final static String MS_REASON = "";
+//# public final static String MS_YOU_HAVE_BEEN_INVITED = " ";
+//# public final static String MS_DISCO_ROOM = "";
+//# public final static String MS_CAPS_STATE = "";
+//# public final static String MS_STORE_PRESENCE = " ";
+//# public final static String MS_IS_NOW_KNOWN_AS = " ";
+//# public final static String MS_WAS_BANNED = " ";
+//# public final static String MS_WAS_KICKED = " ";
+//# public final static String MS_HAS_BEEN_KICKED_BECAUSE_ROOM_BECAME_MEMBERS_ONLY = " , .. ";
+//# public final static String MS_HAS_LEFT_CHANNEL = " ";
+//# public final static String MS_HAS_JOINED_THE_CHANNEL_AS = " ";
+//# public final static String MS_AND = " ";
+//# public final static String MS_IS_NOW = " ";
+//# public final static String MS_AUTOFOCUS = "";
+//# public final static String MS_GRANT_MEMBERSHIP = " ";
+//# public final static String MS_SURE_CLEAR = " ?";
+//# public final static String MS_TOKEN = " Google";
+//# public final static String MS_SASL = "SASL-";
+//# public final static String MS_FEATURES = "";
+//# public final static String MS_SHOWPWD = " ";
+//# public final static String MS_NO_VERSION_AVAILABLE = " ";
+//# public final static String MS_MSG_LIMIT = " ";
+//# public final static String MS_OPENING_STREAM = " ";
+//# public final static String MS_ZLIB = " ";
+//# public final static String MS_AUTH = "";
+//# public final static String MS_RESOURCE_BINDING = " ";
+//# public final static String MS_SESSION = " ";
+//# public final static String MS_TEXTWRAP = " ";
+//# public final static String MS_TEXTWRAP_CHARACTER = " ";
+//# public final static String MS_TEXTWRAP_WORD = " ";
+//# public final static String MS_INFO = "";
+//# public final static String MS_REPLY = "";
+//# public final static String MS_DIRECT_PRESENCE = " ";
+//# public final static String MS_CONFIRM_BAN = " , ?";
+//# public final static String MS_RECENT = " ";
+//# public final static String MS_CAMERASHOT = "";
+//# public final static String MS_SELECT_FILE = " ";
+//# public final static String MS_LOAD_PHOTO = " ";
+//# public final static String MS_CLEAR_PHOTO = " ";
+//# public final static String MS_CAMERA = "";
+//# public final static String MS_HIDE_FINISHED = " ";
+//# public final static String MS_TRANSFERS = " ";
+//# public final static String MS_SURE_DELETE = " ?";
+//# public final static String MS_NEW_BOOKMARK = " ";
+//# public final static String MS_ROOT = " ";
+//# public final static String MS_DECLINE = "";
+//# public final static String MS_AUTH_NEW = ". ";
+//# public final static String MS_AUTH_AUTO = "[]";
+//# public final static String MS_KEEPALIVE = " Keep-Alive";
+//# public final static String MS_HAS_BEEN_UNAFFILIATED_AND_KICKED_FROM_MEMBERS_ONLY_ROOM = " , .. ";
+//# public final static String MS_AWAY_PERIOD = " ()";
+//# public final static String MS_AWAY_TYPE = " ";
+//# public final static String MS_AWAY_OFF = "";
+//# public final static String MS_AWAY_LOCK = " / ";
+//# public final static String MS_AWAY_IDLE = "";
+//# public final static String MS_ADD_AUTOJ = ". ";
+//#
+//# public final static String MS_DO_AUTOJOIN = " "; //temporary
+//# public final static String MS_SHOW_HARDWARE = " ";
+//# public final static String MS_DELIVERY = " ";
+//# public final static String MS_FONTSIZE_NORMAL = "";
+//# public final static String MS_FONTSIZE_SMALL = " ";
+//# public final static String MS_FONTSIZE_LARGE = "";
+//# public final static String MS_FILE_TRANSFERS = " ";
+//# public final static String MS_ALERT_PROFILE_AUTO = "";
+//# public final static String MS_ALERT_PROFILE_ALLSIGNALS = " ";
+//# public final static String MS_ALERT_PROFILE_VIBRA = "";
+//# public final static String MS_ALERT_PROFILE_SOUND = "";
+//# public final static String MS_ALERT_PROFILE_NOSIGNALS = " ";
+//# public final static String MS_ALERT_PROFILE_DEFAULT = " ( )";
+//#
+//# public final static String MS_PASTE = "";
+//# public final static String MS_MESSAGE_COLLAPSE_LIMIT = " ";
+//#endif
+
+
+//#if (!ReleaseZLITE)
+ public static String MS_XMLLANG;
+ public static String MS_IFACELANG;
+
private SR() { }
private static Hashtable presences;
@@ -412,7 +706,7 @@
System.err.print(key);
System.err.println('>');
}
- }
+ }
//#endif
return (value==null)?key:value;
}
@@ -424,5 +718,28 @@
public static void loaded() {
lang=null;
}
-
+//#else
+//# private SR() { }
+//#
+//# public final static String MS_XMLLANG = "ru";
+//# public final static String MS_IFACELANG = "ru";
+//#
+//# private static Hashtable presences=new Hashtable();
+//# {
+//# presences.put("online", "");
+//# presences.put("chat", " ");
+//# presences.put("away", "");
+//# presences.put("xa", "");
+//# presences.put("invisible", "");
+//# presences.put("dnd", " ");
+//# presences.put("unavailable", "");
+//# }
+//#
+//# public static String getPresence(String presenceName) {
+//# return (String) presences.get(presenceName);
+//# }
+//#
+//# public static void loaded() {
+//# }
+//#endif
}
Index: bombus-plus/export/trunk/src/xml/XMLParser.java
===================================================================
--- bombus-plus/export/trunk/src/xml/XMLParser.java (revision 1363)
+++ bombus-plus/export/trunk/src/xml/XMLParser.java (working copy)
@@ -36,7 +36,12 @@
import io.*;
public class XMLParser {
- private final static int MAX_BIN_DATASIZE=64*1024; //64 KB - experimental
+ private final static int MAX_BIN_DATASIZE=
+//#if ReleaseZVOFFK
+//# 20*1024;
+//#else
+ 64*1024; //64 KB - experimental
+//#endif
private final static int PLAIN_TEXT=0;
private final static int TAGNAME=1;
Index: bombus-plus/export/trunk/src/images/RosterIcons.java
===================================================================
--- bombus-plus/export/trunk/src/images/RosterIcons.java (revision 1363)
+++ bombus-plus/export/trunk/src/images/RosterIcons.java (working copy)
@@ -139,5 +139,11 @@
public static final int ICON_KEYBLOCK_INDEX = 0x17;
public static Integer iconHasVcard=new Integer(ICON_SEARCH_INDEX);
+
+ public static final int ICON_GCCOLLAPSED_INDEX = 0x42; //
+
+ public static final int ICON_VIEWING_INDEX = 0x57; //
+
+ public static final int ICON_APPEARING_INDEX = 0x36; //
}
Index: bombus-plus/export/trunk/src/Conference/MucContact.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/MucContact.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/MucContact.java (working copy)
@@ -138,7 +138,7 @@
break;
case ROLE_VISITOR:
transport=RosterIcons.getInstance().getTransportIndex("muc#vis");
- key0=3;
+ key0=2; //
break;
default:
transport=0;
@@ -207,7 +207,15 @@
break;
default:
- b.append(SR.MS_HAS_LEFT_CHANNEL);
+ //
+ //b.append(SR.MS_HAS_LEFT_CHANNEL);
+ b.append(SR.MS_HAS_LEFT_THE_ROOM);
+
+ if (realJid!=null) {
+ b.append(" - ");
+ appendL(b,realJid);
+ }
+ //
if (statusText.length()>0) {
b.append(" (");
@@ -227,7 +235,7 @@
appendL(b, realJid);
b.append(')');
}
- b.append(SR.MS_HAS_JOINED_THE_CHANNEL_AS);
+ b.append(SR.MS_HAS_JOINED_THE_ROOM_AS);
b.append(role);
if (!affiliation.equals("none")) {
b.append(SR.MS_AND);
Index: bombus-plus/export/trunk/src/Conference/InviteForm.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/InviteForm.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/InviteForm.java (working copy)
@@ -41,7 +41,8 @@
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.TextField;
import locale.SR;
-import ui.ConstMIDP;
+//import ui.ConstMIDP;
+import ui.controls.TextFieldCombo; //
/**
*
@@ -67,9 +68,9 @@
parentView=display.getCurrent();
form=new Form(SR.MS_INVITE);
- reason=new TextField(SR.MS_REASON, null, 200, TextField.ANY);
+ reason=new TextFieldCombo(SR.MS_REASON, "", 200, TextField.ANY, "muc-invite-reasons", display); //
- conferenceList=new ChoiceGroup (SR.MS_CONFERENCE, ConstMIDP.CHOICE_POPUP);
+ conferenceList=new ChoiceGroup (SR.MS_CONFERENCE, ChoiceGroup.POPUP); //
for (Enumeration c=StaticData.getInstance().roster.getHContacts().elements(); c.hasMoreElements(); ) {
try {
MucContact mc=(MucContact)c.nextElement();
Index: bombus-plus/export/trunk/src/Conference/ConferenceGroup.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/ConferenceGroup.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/ConferenceGroup.java (working copy)
@@ -45,6 +45,7 @@
super(name);
this.label=label;
imageExpandedIndex=RosterIcons.ICON_GCJOIN_INDEX;
+ imageCollapsedIndex=RosterIcons.ICON_GCCOLLAPSED_INDEX; //
this.type=Groups.TYPE_MUC;
}
Index: bombus-plus/export/trunk/src/Conference/affiliation/ConferenceQuickPrivelegeModify.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/affiliation/ConferenceQuickPrivelegeModify.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/affiliation/ConferenceQuickPrivelegeModify.java (working copy)
@@ -39,7 +39,7 @@
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
//#if (!MIDP1)
-import javax.microedition.lcdui.Spacer;
+//import javax.microedition.lcdui.Spacer;
//#endif
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
@@ -68,7 +68,7 @@
private MucContact victim;
private Command cmdOk;
- private Command cmdNoReason=new Command(SR.MS_NO_REASON, Command.SCREEN, 2);
+ //private Command cmdNoReason=new Command(SR.MS_NO_REASON, Command.SCREEN, 2);
private Command cmdCancel=new Command(SR.MS_CANCEL, Command.BACK, 99);
private int action;
@@ -117,7 +117,7 @@
f.append(new StringItem(SR.MS_USER, user.toString()));
//#if (!MIDP1)
- f.append(new Spacer(256, 33));
+ //f.append(new Spacer(256, 33));
//#endif
reason=new TextFieldCombo(SR.MS_REASON, "", 256, TextField.ANY, "reason", display);
@@ -125,7 +125,7 @@
cmdOk=new Command( okName, Command.SCREEN, 1);
f.addCommand(cmdOk);
- f.addCommand(cmdNoReason);
+ //f.addCommand(cmdNoReason);
f.addCommand(cmdCancel);
f.setCommandListener(this);
@@ -133,10 +133,10 @@
}
public void commandAction(Command command, Displayable displayable) {
- if (command==cmdNoReason) {
+ /*if (command==cmdNoReason) {
reason.setString("");
return;
- }
+ }*/
if (command==cmdOk) setMucMod();
display.setCurrent(StaticData.getInstance().roster);
Index: bombus-plus/export/trunk/src/Conference/affiliation/Affiliations.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/affiliation/Affiliations.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/affiliation/Affiliations.java (working copy)
@@ -40,6 +40,9 @@
import ui.ImageList;
import ui.VirtualElement;
import ui.VirtualList;
+//#ifdef CLIPBOARD
+//# import util.ClipBoard; //
+//#endif
/**
*
@@ -61,7 +64,10 @@
private Command cmdCancel=new Command (SR.MS_BACK, Command.BACK, 99);
private Command cmdModify=new Command (SR.MS_MODIFY, Command.SCREEN, 1);
private Command cmdNew=new Command (SR.MS_NEW_JID, Command.SCREEN, 2);
-
+//#ifdef CLIPBOARD
+//# private Command cmdCopy = new Command(SR.MS_COPY, Command.SCREEN, 3);
+//# private ClipBoard clipboard;
+//#endif
protected VirtualElement getItemRef(int index) { return (VirtualElement) items.elementAt(index); }
protected int getItemCount() { return items.size(); }
@@ -74,11 +80,11 @@
this.room=room;
//fix for old muc
- switch (affiliationIndex) {
+ /*switch (affiliationIndex) {
case AffiliationItem.AFFILIATION_OWNER:
case AffiliationItem.AFFILIATION_ADMIN:
if (!Config.getInstance().muc119) namespace="http://jabber.org/protocol/muc#owner";
- }
+ }*/ //
this.id=AffiliationItem.getAffiliationName(affiliationIndex);
@@ -90,6 +96,13 @@
addCommand(cmdModify);
addCommand(cmdNew);
+//#ifdef CLIPBOARD
+//# if (Config.getInstance().useClipBoard) {
+//# clipboard=ClipBoard.getInstance();
+//# addCommand(cmdCopy);
+//# }
+//#endif
+
setCommandListener(this);
getList();
}
@@ -103,6 +116,17 @@
public void commandAction(Command c, Displayable d){
if (c==cmdNew) new AffiliationModify(display, room, null, "none", "");
if (c==cmdModify) eventOk();
+
+//#ifdef CLIPBOARD
+//# if (c==cmdCopy) {
+//# try {
+//# AffiliationItem item=(AffiliationItem)getFocusedObject();
+//# if (item.jid!=null)
+//# clipboard.setClipBoard(item.jid);
+//# } catch (Exception e) {/*no messages*/}
+//# }
+//#endif
+
if (c!=cmdCancel) return;
stream.cancelBlockListener(this);
destroyView();
Index: bombus-plus/export/trunk/src/Conference/affiliation/AffiliationModify.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/affiliation/AffiliationModify.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/affiliation/AffiliationModify.java (working copy)
@@ -33,9 +33,12 @@
import com.alsutton.jabber.datablocks.Iq;
import javax.microedition.lcdui.*;
import locale.SR;
-import ui.ConstMIDP;
+//import ui.ConstMIDP;
import ui.YesNoAlert;
import ui.controls.TextFieldCombo;
+//#if CLIPBOARD
+//# import ui.controls.TextFieldEx; //
+//#endif
/**
*
@@ -65,13 +68,17 @@
this.room=room;
// WARNING!!! 1000 is experimental value. this length is required by RFC (reference?),
// but may not supported by some phones
- this.jid=new TextField(SR.MS_JID , jid, 1000, ConstMIDP.TEXTFIELD_URL);
+//#if CLIPBOARD
+//# this.jid=new TextFieldEx(SR.MS_JID , jid, 1000, TextField.URL);
+//#else
+ this.jid=new TextField(SR.MS_JID , jid, 1000, TextField.URL); //
+//#endif
TextFieldCombo.setLowerCaseLatin(this.jid);
this.reason=new TextFieldCombo(SR.MS_REASON, reason, 256, TextField.ANY, "reason", display);
f.append(this.jid);
- this.affiliation=new ChoiceGroup(SR.MS_SET_AFFILIATION /*"Set affiliation to"*/, ui.ConstMIDP.CHOICE_POPUP);
+ this.affiliation=new ChoiceGroup(SR.MS_SET_AFFILIATION /*"Set affiliation to"*/, ChoiceGroup.POPUP); //
for (int index=0; index<=AffiliationItem.AFFILIATION_OUTCAST; index++) {
String name=AffiliationItem.getAffiliationName(index);
this.affiliation.append(name, null);
Index: bombus-plus/export/trunk/src/Conference/Bookmarks.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/Bookmarks.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/Bookmarks.java (working copy)
@@ -28,7 +28,7 @@
package Conference;
import Client.*;
import ServiceDiscovery.ServiceDiscovery;
-import images.RosterIcons;
+//import images.RosterIcons;
import javax.microedition.lcdui.*;
import locale.SR;
import ui.*;
@@ -42,7 +42,7 @@
*/
public class Bookmarks
extends VirtualList
- implements CommandListener
+ implements CommandListener, YesNoAlert.YesNoListener //<+voffk>
{
//private Vector bookmarks;
@@ -57,13 +57,15 @@
//private Command cmdRfsh=new Command (SR.MS_REFRESH, Command.SCREEN, 20);
private Command cmdNew=new Command (SR.MS_NEW_BOOKMARK, Command.SCREEN, 20);
private Command cmdDel=new Command (SR.MS_DELETE, Command.SCREEN, 30);
-
+ //
+ private Command cmdUp=new Command (SR.MS_MOVE_UP, Command.SCREEN, 21);
+ private Command cmdDwn=new Command (SR.MS_MOVE_DOWN, Command.SCREEN, 22);
+ private Command cmdSort=new Command ("Sort bookmarks", Command.SCREEN, 23);
+ private Command cmdSave=new Command (SR.MS_SAVE_LIST, Command.SCREEN, 24);
+ //
-
Roster roster=StaticData.getInstance().roster;
- JabberStream stream=roster.theStream;
-
/** Creates a new instance of Bookmarks */
public Bookmarks(Display display, BookmarkItem toAdd) {
super ();
@@ -86,9 +88,16 @@
addCommand(cmdDoAutoJoin);
//addCommand(cmdRfsh);
addCommand(cmdNew);
- addCommand(cmdDel);
+
+ addCommand(cmdUp);
+ addCommand(cmdDwn);
+ addCommand(cmdSort);
+ addCommand(cmdSave);
+
+ //addCommand(cmdDel);
addCommand(cmdDisco);
addCommand(cmdConfigure);
+ addCommand(cmdDel);
setCommandListener(this);
attachDisplay(display);
}
@@ -109,21 +118,25 @@
private void addBookmark() {
if (toAdd!=null) {
- Vector bm=StaticData.getInstance().roster.bookmarks;
+ StaticData.getInstance().roster.bookmarks.addElement(toAdd);
+ //Vector bm=StaticData.getInstance().roster.bookmarks;
- bm.addElement(toAdd);
- sort(bm);
+ //bm.addElement(toAdd);
+ //sort(bm); //<*voffk>
saveBookmarks();
}
}
- public void eventOk(){
- if (getItemCount()==0) return;
+ public void eventOk(){ //<*voffk>
+ /*if (getItemCount()==0) return;
BookmarkItem join=(BookmarkItem)getFocusedObject();
if (join==null) return;
if (join.isUrl) return;
- new ConferenceForm(display, join.toString(), join.password);
+ new ConferenceForm(display, join.toString(), join.password);*/
+ BookmarkItem bm=(BookmarkItem)getFocusedObject();
+ ConferenceForm.join(bm.jid+'/'+bm.nick, bm.password, 20);
+ exitBookmarks();
}
public void commandAction(Command c, Displayable d){
@@ -134,13 +147,23 @@
}
if (getItemCount()==0) return;
- if (c==cmdJoin) eventOk();
- //if (c==cmdRfsh) loadBookmarks();
+
+ //
+ if (c==cmdJoin) {//eventOk();
+ if (getItemCount()==0) return;
+ BookmarkItem join=(BookmarkItem)getFocusedObject();
+ if (join==null) return;
+ if (join.isUrl) return;
+ new ConferenceForm(display, join.toString(), join.password);
+ }
+
if (c==cmdDel) {
- deleteBookmark();
- setTitleItem(new Title(2, null, SR.MS_BOOKMARKS+" ("+getItemCount()+") "));
+ new YesNoAlert(display, SR.MS_DELETE, "Are you sure want to delete bookmark "+((BookmarkItem)getFocusedObject()).name+" ?", this);
+ //deleteBookmark();
+ //setTitleItem(new Title(2, null, SR.MS_BOOKMARKS+" ("+getItemCount()+") "));
return;
}
+ //
String roomJid=((BookmarkItem)getFocusedObject()).getJid();
@@ -156,18 +179,28 @@
}
exitBookmarks();
}
-
+
+ //
+ if (c==cmdUp) { move(-1); keyUp(); }
+
+ if (c==cmdDwn) { move(+1); keyDwn(); }
+
+ if (c==cmdSort) sort(StaticData.getInstance().roster.bookmarks);
+
+ if (c==cmdSave) saveBookmarks();
+
+ redraw();
+ //
}
- private void deleteBookmark(){
+ /*private void deleteBookmark(){
BookmarkItem del=(BookmarkItem)getFocusedObject();
if (del==null) return;
if (del.isUrl) return;
StaticData.getInstance().roster.bookmarks.removeElement(del);
if (getItemCount()<=cursor) moveCursorEnd();
saveBookmarks();
- redraw();
- }
+ } */ //<-voffk>
private void saveBookmarks() {
new BookmarkQuery(BookmarkQuery.SAVE);
@@ -178,4 +211,32 @@
//destroyView();
display.setCurrent(roster);
}
+
+ //<+voffk>
+ public void move(int offset){
+ try {
+ int index=cursor;
+ BookmarkItem p1=(BookmarkItem)getItemRef(index);
+ BookmarkItem p2=(BookmarkItem)getItemRef(index+offset);
+
+ roster.bookmarks.setElementAt(p1, index+offset);
+ roster.bookmarks.setElementAt(p2, index);
+ } catch (Exception e) {/* IndexOutOfBounds */}
+ }
+
+ public void userKeyPressed(int keyCode) {
+ if (keyCode==keyClear)
+ new YesNoAlert(display, SR.MS_DELETE, "Are you sure want to delete bookmark "+((BookmarkItem)getFocusedObject()).name+" ?", this);
+ }
+
+ public void ActionConfirmed() { //delete bookmark
+ BookmarkItem del=(BookmarkItem)getFocusedObject();
+ if (del==null) return;
+ if (del.isUrl) return;
+ StaticData.getInstance().roster.bookmarks.removeElement(del);
+ if (getItemCount()<=cursor) moveCursorEnd();
+ saveBookmarks();
+ setTitleItem(new Title(2, null, SR.MS_BOOKMARKS+" ("+getItemCount()+") "));
+ }
+ //
}
Index: bombus-plus/export/trunk/src/Conference/BookmarkQuery.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/BookmarkQuery.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/BookmarkQuery.java (working copy)
@@ -36,7 +36,7 @@
import com.alsutton.jabber.datablocks.Presence;
import java.util.Enumeration;
import java.util.Vector;
-import ui.VirtualList;
+//import ui.VirtualList; //<-voffk>
import util.StringLoader;
/**
@@ -87,7 +87,7 @@
if (bookmarks.isEmpty())
loadDefaults(bookmarks);
- VirtualList.sort(bookmarks);
+ //VirtualList.sort(bookmarks); //<-voffk>
StaticData.getInstance().roster.bookmarks=bookmarks;
StaticData.getInstance().roster.redraw();
Index: bombus-plus/export/trunk/src/Conference/ConferenceForm.java
===================================================================
--- bombus-plus/export/trunk/src/Conference/ConferenceForm.java (revision 1363)
+++ bombus-plus/export/trunk/src/Conference/ConferenceForm.java (working copy)
@@ -58,8 +58,8 @@
StaticData sd=StaticData.getInstance();
/** Creates a new instance of GroupChatForm */
- public ConferenceForm(Display display) {
- String room=Config.getInstance().defGcRoom;
+ public ConferenceForm(Display display) { //
+ /*String room=Config.getInstance().defGcRoom;
String server=null;
// trying to split string like room@server
int roomE=room.indexOf('@');
@@ -69,7 +69,8 @@
}
// default server
if (server==null) server="conference."+sd.account.getServer();
- createForm(display, room, server, null, null);
+ createForm(display, room, server, null, null); */
+ createForm(display, "bombus-plus", "conference.jabbus.org", null, null);
}
/** Creates a new instance of GroupChatForm */
@@ -100,11 +101,11 @@
Form formJoin=new Form(SR.MS_JOIN_CONFERENCE);
- roomField=new TextField(SR.MS_ROOM, room, 64, TextField.ANY);
+ roomField=new TextFieldCombo(SR.MS_ROOM, room, 64, TextField.ANY, "muc-room", display); //
TextFieldCombo.setLowerCaseLatin(roomField);
formJoin.append(roomField);
- hostField=new TextFieldCombo(SR.MS_AT_HOST, server, 64, ConstMIDP.TEXTFIELD_URL, "muc-host", display);
+ hostField=new TextFieldCombo(SR.MS_AT_HOST, server, 64, TextField.URL, "muc-host", display); //
TextFieldCombo.setLowerCaseLatin(hostField);
formJoin.append(hostField);
@@ -114,8 +115,8 @@
msgLimitField=new NumberField(SR.MS_MSG_LIMIT, 20, 0, 100);
formJoin.append(msgLimitField);
-
- passField=new TextField(SR.MS_PASSWORD, password, 32, TextField.ANY | ConstMIDP.TEXTFIELD_SENSITIVE );
+
+ passField=new TextField(SR.MS_PASSWORD, password, 32, TextField.ANY | TextField.SENSITIVE ); //
formJoin.append(passField);
formJoin.addCommand(cmdJoin);
@@ -181,7 +182,7 @@
JabberDataBlock history=x.addChild("history", null);
history.setAttribute("maxstanzas", String.valueOf(maxStanzas));
- history.setAttribute("maxchars","32768");
+ history.setAttribute("maxchars",/*"32768"*/ "10000"); //
try {
long last=grp.getConference().lastMessageTime;
long delay= ( grp.conferenceJoinTime - last ) /1000 ;
Index: bombus-plus/export/trunk/src/Messages/MessageList.java
===================================================================
--- bombus-plus/export/trunk/src/Messages/MessageList.java (revision 1363)
+++ bombus-plus/export/trunk/src/Messages/MessageList.java (working copy)
@@ -41,6 +41,9 @@
import ui.FontCache;
import ui.VirtualElement;
import ui.VirtualList;
+//#ifdef CLIPBOARD
+//# import util.ClipBoard; //
+//#endif
/**
*
@@ -53,10 +56,17 @@
protected Vector messages;
+//#ifdef CLIPBOARD
+//# private ClipBoard clipboard;
+//#
+//# protected Command cmdCopy = new Command(SR.MS_COPY, Command.SCREEN, 20);
+//# protected Command cmdCopyPlus = new Command("+ "+SR.MS_COPY, Command.SCREEN, 30);
+//#endif
+
protected Command cmdBack = new Command(SR.MS_BACK, Command.BACK, 99);
protected Command cmdUrl = new Command(SR.MS_GOTO_URL, Command.SCREEN, 80);
- protected Command cmdSmiles = new Command(SR.MS_SMILES_TOGGLE, Command.SCREEN, 50);
+ //protected Command cmdSmiles = new Command(SR.MS_SMILES_TOGGLE, Command.SCREEN, 50);
/** Creates a new instance of MessageList */
@@ -66,11 +76,19 @@
smiles=Config.getInstance().smiles;
//sd.config.updateTime();
+//#ifdef CLIPBOARD
+//# if (Config.getInstance().useClipBoard) {
+//# clipboard=ClipBoard.getInstance();
+//# addCommand(cmdCopy);
+//# addCommand(cmdCopyPlus);
+//# }
+//#endif
+
enableListWrapping(false);
cursor=0;//activate
- addCommand(cmdSmiles);
+ //addCommand(cmdSmiles);
addCommand(cmdBack);
addCommand(cmdUrl);
stringHeight=FontCache.getMsgFont().getHeight();
@@ -118,11 +136,36 @@
new MessageUrl(display, urls); //throws NullPointerException if no urls
} catch (Exception e) {/* no urls found */}
}
- if (c==cmdSmiles) {
+ /*if (c==cmdSmiles) {
try {
((MessageItem)getFocusedObject()).toggleSmiles();
} catch (Exception e){}
- }
+ }*/ //
+
+//#ifdef CLIPBOARD
+//# if (c==cmdCopy) {
+//# try {
+//# StringBuffer clipstr=new StringBuffer();
+//# //clipstr.append((((MessageItem)getFocusedObject()).msg.subject==null)?"":((MessageItem)getFocusedObject()).msg.subject+"\n");
+//# clipstr.append(((MessageItem)getFocusedObject()).msg.quoteString());
+//# clipboard.setClipBoard(clipstr.toString());
+//# clipstr=null;
+//# } catch (Exception e) {/*no messages*/}
+//# }
+//#
+//# if (c==cmdCopyPlus) {
+//# try {
+//# StringBuffer clipstr=new StringBuffer();
+//# clipstr.append(clipboard.getClipBoard());
+//# clipstr.append("\n\n");
+//# //clipstr.append((((MessageItem)getFocusedObject()).msg.subject==null)?"":((MessageItem)getFocusedObject()).msg.subject+"\n");
+//# clipstr.append(((MessageItem)getFocusedObject()).msg.quoteString());
+//# clipboard.setClipBoard(clipstr.toString());
+//# clipstr=null;
+//# } catch (Exception e) {/*no messages*/}
+//# }
+//#endif
+
}
protected void keyPressed(int keyCode) { // overriding this method to avoid autorepeat
Index: bombus-plus/export/trunk/src/Messages/MessageParser.java
===================================================================
--- bombus-plus/export/trunk/src/Messages/MessageParser.java (revision 1363)
+++ bombus-plus/export/trunk/src/Messages/MessageParser.java (working copy)
@@ -35,6 +35,7 @@
import ui.*;
import Client.Msg;
import Client.Config;
+import util.strconv; //<+voffk>
/**
*
* @author Eugene Stahov
@@ -146,7 +147,8 @@
//case 0x20:
// конец строки смайлика
- String smile=s.toString();
+ //String smile=s.toString();
+ String smile=strconv.convCp1251ToUnicode(s.toString()); //
if (firstSmile) smileTable.addElement(smile);
addSmile(root, smile,strnumber);
Index: bombus-plus/export/trunk/src/Messages/MessageUrl.java
===================================================================
--- bombus-plus/export/trunk/src/Messages/MessageUrl.java (revision 1363)
+++ bombus-plus/export/trunk/src/Messages/MessageUrl.java (working copy)
@@ -32,6 +32,12 @@
import javax.microedition.lcdui.Display;
import midlet.Bombus;
import ui.Menu;
+//
/**
*
@@ -54,11 +60,11 @@
public void eventOk() {
String url=(String)urlList.elementAt(cursor);
-//#if !(MIDP1)
try {
Bombus.getInstance().platformRequest(url);
} catch (Exception e) { e.printStackTrace(); }
-//#endif
- destroyView();
+ //destroyView();
+ /*Msg urlMsg=new Msg(Msg.MESSAGE_TYPE_IN, "xxx", null, url);
+ MessageArchive.store(urlMsg);*/ //
}
}
Index: bombus-plus/export/trunk/src/io/file/browse/Browser.java
===================================================================
--- bombus-plus/export/trunk/src/io/file/browse/Browser.java (revision 1363)
+++ bombus-plus/export/trunk/src/io/file/browse/Browser.java (working copy)
@@ -65,7 +65,7 @@
Command cmdInfo=new Command(SR.MS_INFO, Command.SCREEN, 3);
Command cmdRoot=new Command(SR.MS_ROOT, Command.SCREEN, 4);
Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 98);
- Command cmdCancel=new Command(SR.MS_CANCEL, Command.EXIT, 99);
+ Command cmdCancel=new Command(SR.MS_CANCEL, Command.SCREEN, 99);
private String path;
private BrowserListener browserListener;
Index: bombus-plus/export/trunk/src/io/file/transfer/TransferAcceptFile.java
===================================================================
--- bombus-plus/export/trunk/src/io/file/transfer/TransferAcceptFile.java (revision 1363)
+++ bombus-plus/export/trunk/src/io/file/transfer/TransferAcceptFile.java (working copy)
@@ -57,7 +57,7 @@
TextField path;
Command cmdOk=new Command(SR.MS_OK, Command.OK, 1);
- Command cmdDecline=new Command(SR.MS_CANCEL, Command.CANCEL, 90);
+ Command cmdDecline=new Command(SR.MS_CANCEL, Command.SCREEN, 90);
Command cmdBack=new Command(SR.MS_BACK, Command.BACK, 99);
Command cmdPath=new Command(SR.MS_PATH, Command.SCREEN, 2);
/** Creates a new instance of TransferAcceptFile */
Index: bombus-plus/export/trunk/src/io/DnsSrvResolver.java
===================================================================
--- bombus-plus/export/trunk/src/io/DnsSrvResolver.java (revision 1363)
+++ bombus-plus/export/trunk/src/io/DnsSrvResolver.java (working copy)
@@ -56,7 +56,7 @@
StringBuffer url=new StringBuffer(resolverUrl);
url.append("?host=").append(server);
- url.append("&client=").append(strconv.urlPrep(Info.Version.getNameVersion()));
+ url.append("&client=").append(strconv.urlPrep(strconv.stringReplace(Info.Version.getNameVersion(), "+", "Plus"))); //
url.append("%2F");
if (Client.Config.getInstance().enableVersionOs) {
@@ -72,7 +72,9 @@
url.append(md5sum.getDigestHex());
- System.out.println(url.toString());
+//#if DEBUG
+ System.out.println(url.toString()); //
+//#endif
try {
HttpConnection c = (HttpConnection) Connector.open(url.toString());
Index: bombus-plus/export/trunk/src/io/Utf8IOStream.java
===================================================================
--- bombus-plus/export/trunk/src/io/Utf8IOStream.java (revision 1363)
+++ bombus-plus/export/trunk/src/io/Utf8IOStream.java (working copy)
@@ -38,6 +38,10 @@
import javax.microedition.io.*;
import Client.Config;
import util.strconv;
+//
+//#ifdef XML_CONSOLE
+//# import xml.console.StanzasList;
+//#endif
/**
*
@@ -59,7 +63,7 @@
//#if (ZLIB)
public void setStreamCompression(){
inpStream=new ZInputStream(inpStream);
- outStream=new ZOutputStream(outStream, JZlib.Z_DEFAULT_COMPRESSION);
+ outStream=new ZOutputStream(outStream, /*JZlib.Z_DEFAULT_COMPRESSION */JZlib.Z_BEST_COMPRESSION);
((ZOutputStream)outStream).setFlushMode(JZlib.Z_SYNC_FLUSH);
}
//#endif
@@ -100,11 +104,14 @@
outStream.write(bytes);
bytesSent+=outLen;
- outStream.flush();
+ outStream.flush();
}
//#if (XML_STREAM_DEBUG)
-//# System.out.println(">> "+data);
+//# System.out.println("OUT: "+data);
//#endif
+//#ifdef XML_CONSOLE
+//# StanzasList.getInstance().add(data.toString(), 1);
+//#endif
}
@@ -122,7 +129,9 @@
if (avail>buf.length) avail=buf.length;
avail=inpStream.read(buf, 0, avail);
-
+//#if (XML_STREAM_DEBUG)
+//# System.out.println("IN: "+new String(buf, 0, avail)); //
+//#endif
bytesRecv+=avail;
return avail;
}
@@ -147,13 +156,13 @@
String ratio=Long.toString((10*unpacked)/packed);
int dotpos=ratio.length()-1;
- /*
+ //compression ratio
s.append(" ratio=");
s.append( (dotpos==0)? "0":ratio.substring(0, dotpos));
s.append('.');
s.append(ratio.substring(dotpos));
s.append('x');
- */
+
}
public String getStreamStats() {
@@ -165,25 +174,58 @@
recv+=z.getTotalIn()-z.getTotalOut();
ZOutputStream zo = (ZOutputStream) outStream;
sent+=zo.getTotalOut()-zo.getTotalIn();
- stats.append("ZLib:\nin="); appendZlibStats(stats, z.getTotalIn(), z.getTotalOut(), true);
+ stats.append(" ZLib:\nin="); appendZlibStats(stats, z.getTotalIn(), z.getTotalOut(), true); //
stats.append("\nout="); appendZlibStats(stats, zo.getTotalOut(), zo.getTotalIn(), false);
}
- stats.append("\nStream:\nin="); stats.append(recv);
+ stats.append("\n Stream:\nin="); stats.append(recv); //
stats.append("\nout="); stats.append(sent);
- stats.append("\n\n");
+ stats.append("\n netstat: "); //
try {
stats.append(((SocketConnection)connection).getLocalAddress());
stats.append(":");
stats.append(((SocketConnection)connection).getLocalPort());
- stats.append("->");
+ } catch (Exception ex) {
+ stats.append("unknown");
+ }
+ stats.append("->"); //
+ try {
stats.append(((SocketConnection)connection).getAddress());
stats.append(":");
stats.append(((SocketConnection)connection).getPort());
} catch (Exception ex) {
stats.append("unknown");
- }
-
+ }
return stats.toString();
}
//#endif
+
+//#if TRAFFIC
+ public int getTrafficBytes() {//
+ int sent=this.bytesSent;
+ int recv=this.bytesRecv;
+ //#if ZLIB
+ if (inpStream instanceof ZInputStream) {
+ ZOutputStream zo = (ZOutputStream) outStream;
+ ZInputStream z = (ZInputStream) inpStream;
+ sent+=zo.getTotalOut()-zo.getTotalIn();
+ recv+=z.getTotalIn()-z.getTotalOut();
+ return recv+sent;
+ }
+ return (this.bytesSent+this.bytesRecv);
+ //#else
+//# return (this.bytesSent+this.bytesRecv);
+ //#endif
+ /*BombusMod:
+ try {
+ if (inpStream instanceof ZInputStream) {
+ ZOutputStream zo = (ZOutputStream) outStream;
+ ZInputStream z = (ZInputStream) inpStream;
+ return ((int)zo.getTotalOut()+(int)z.getTotalIn());
+ }
+ return (this.bytesSent+this.bytesRecv);
+ } catch (Exception e) { }
+ return 0;*/
+ }
+//#endif
+
}
Index: bombus-plus/export/trunk/src/login/SASLAuth.java
===================================================================
--- bombus-plus/export/trunk/src/login/SASLAuth.java (revision 1363)
+++ bombus-plus/export/trunk/src/login/SASLAuth.java (working copy)
@@ -75,7 +75,11 @@
if (data.getTagName().equals("stream:features")) {
//#if ZLIB
JabberDataBlock compr=data.getChildBlock("compression");
- if (compr!=null && account.useCompression()) {
+ if (compr!=null
+ //#if !NONSASL_ENABLE
+ && account.useCompression() //
+ //#endif
+ ) {
if (compr.getChildBlockByText("zlib")!=null) {
// negotiating compression
JabberDataBlock askCompr=new JabberDataBlock("compress", null, null);
@@ -156,7 +160,7 @@
return JabberBlockListener.BLOCK_PROCESSED;
}
- listener.loginFailed("Server does not support SASL");
+ listener.loginFailed("Server does not support SASL");
return JabberBlockListener.NO_MORE_BLOCKS;
} else if (data.getTagName().equals("challenge")) {
// first stream - step 2,3. reaction to challenges
@@ -172,7 +176,7 @@
if (nonceIndex>=0) {
nonceIndex+=7;
String nonce=challenge.substring(nonceIndex, challenge.indexOf('\"', nonceIndex));
- String cnonce=Config.getInstance().getStringProperty("Bombus-CNonce", "123456789abcd");
+ String cnonce=Config.getInstance().getStringProperty("Bombus-CNonce", "123456789abcd");
resp.setText(responseMd5Digest(
strconv.unicodeToUTF(account.getUserName()),
Index: bombus-plus/export/trunk/src/ui/Colors.java
===================================================================
--- bombus-plus/export/trunk/src/ui/Colors.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/Colors.java (working copy)
@@ -195,8 +195,8 @@
PGS_BORDER = loadColor("PGS_BORDER", 0x808080);
PGS_BGND = loadColor("PGS_BGND", 0x000000);
- HEAP_TOTAL = loadColor("HEAP_TOTAL", 0xffffff);
- HEAP_FREE = loadColor("HEAP_FREE", 0x00007f);
+ HEAP_TOTAL = loadColor("HEAP_TOTAL", 0xffffff /*0x000000 0x0033ff*/);
+ HEAP_FREE = loadColor("HEAP_FREE", 0x00007f /*0xFF1493 0xee0000*/);
CURSOR_BGND = loadColor("CURSOR_BGND", 0xC8D7E6);
CURSOR_OUTLINE = loadColor("CURSOR_OUTLINE", 0x000066);
@@ -214,14 +214,18 @@
String themeFile=Config.getInstance().themeFileName();
if (themeFile==null) theme=new Hashtable();
else theme=new StringLoader().hashtableLoader(themeFile);
+//#if DEBUG
System.out.println("Loading color theme "+themeFile);
+//#endif
}
try {
String value=(String)theme.get(key);
return Integer.parseInt(value.substring(2),16);
} catch (Exception e) {
+//#if DEBUG
System.out.print("Can't find:");
System.out.println(key); //colors debug
+//#endif
return defaultColor;
}
}
Index: bombus-plus/export/trunk/src/ui/EventNotify.java
===================================================================
--- bombus-plus/export/trunk/src/ui/EventNotify.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/EventNotify.java (working copy)
@@ -66,14 +66,14 @@
//#endif
private final static String tone="A6E6J6";
- //private int sndVolume;
+ private int sndVolume;
/** Creates a new instance of EventNotify */
public EventNotify(
Display display,
String soundMediaType,
String soundFileName,
- //int sndVolume,
+ int sndVolume,
int vibraLength,
boolean enableLights
) {
@@ -83,7 +83,7 @@
this.lenVibra=vibraLength;
this.enableLights=enableLights;
if (soundType!=null) toneSequence= soundType.equals("tone");
- //this.sndVolume=100;
+ this.sndVolume=sndVolume;
}
public void startNotify (){
@@ -104,10 +104,10 @@
player.prefetch();
-// try {
-// VolumeControl vol=(VolumeControl) player.getControl("VolumeControl");
-// vol.setLevel(sndVolume);
-// } catch (Exception e) { e.printStackTrace(); }
+ try {
+ VolumeControl vol=(VolumeControl) player.getControl("VolumeControl");
+ vol.setLevel(sndVolume);
+ } catch (Exception e) { e.printStackTrace(); }
player.start();
//#endif
@@ -142,7 +142,7 @@
//#if USE_SIEMENS_API || !(MIDP1)
int note=(tone.charAt(i++)-'A')+12*(tone.charAt(i++)-'0');
int duration=150;
- Manager.playTone(note, duration, 100);
+ Manager.playTone(note, duration, sndVolume);
Thread.sleep(duration);
//#endif
}
Index: bombus-plus/export/trunk/src/ui/ImageList.java
===================================================================
--- bombus-plus/export/trunk/src/ui/ImageList.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/ImageList.java (working copy)
@@ -49,8 +49,10 @@
width = resImage.getWidth()/columns;
height = (rows==0)? width : resImage.getHeight()/rows;
} catch (Exception e) {
+//#if DEBUG
System.out.print("Can't load ");
System.out.println(resource);
+//#endif
}
}
Index: bombus-plus/export/trunk/src/ui/VirtualList.java
===================================================================
--- bombus-plus/export/trunk/src/ui/VirtualList.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/VirtualList.java (working copy)
@@ -130,6 +130,7 @@
public static int greenKeyCode=SIEMENS_GREEN;
public static boolean fullscreen=false;
public static boolean memMonitor;
+ int memMonitorHeight=(memMonitor)?2:0; //<+voffk>
/** метрика экрана */
int width;
@@ -148,13 +149,13 @@
/**
* окно приклеено к позиции курсора
- * ПРИКЛЕИВАЕТСЯ:
+ * ПР?КЛЕ?ВАЕТСЯ:
* при нажатии кнопок перемещения курсора
* при выборе стилусом элемента списка
- * ОТКЛЕИВАЕТСЯ:
+ * ОТКЛЕ?ВАЕТСЯ:
* при использовании скролбара
*/
- protected boolean stickyWindow=true;
+ protected boolean stickyWindow=true; ///!!!!!!!!!!!!!!!!!!
private int itemLayoutY[]=new int[1];
private int listHeight;
@@ -242,7 +243,7 @@
height=getHeight();
if (Info.Version.getPlatformName().startsWith("Windows")) {
- setTitle("Bombus CE");
+ setTitle(Version.NAME+" CE");
}
// rotator
//rotator=new TimerTaskRotate(0, this);
@@ -345,7 +346,7 @@
updateLayout(); //fixme: только при изменении списка
if (title!=null) {
- list_top=title.getVHeight();
+ list_top=title.getVHeight()+memMonitorHeight;
g.setClip(0,0, width, list_top);
g.setColor(getTitleBGndRGB());
g.fillRect(0,0, width, list_top);
@@ -353,7 +354,7 @@
title.drawItem(g,0,false);
}
- drawHeapMonitor(g);
+ //drawHeapMonitor(g); //
winHeight=height-list_top;
@@ -428,7 +429,6 @@
// рисование скроллбара
//g.setColor(VL_BGND);
if (scroll) {
-
setAbsOrg(g, 0, list_top);
g.setClip(0, 0, width, winHeight);
@@ -441,6 +441,9 @@
setAbsOrg(g, 0, 0);
g.setClip(0,0, width, height);
+
+ drawHeapMonitor(g); //<*voffk>
+
if (showBalloon) {
String text=null;
try {
@@ -459,11 +462,13 @@
Balloon.draw(g, text);
}
- private void drawHeapMonitor(final Graphics g) {
+ private void drawHeapMonitor(final Graphics g) { //<*voffk>
if (memMonitor) {
- int ram=(int)((Runtime.getRuntime().freeMemory()*32)/Runtime.getRuntime().totalMemory());
- g.setColor(Colors.HEAP_TOTAL); g.fillRect(width-34,0,34,3);
- g.setColor(Colors.HEAP_FREE); g.fillRect(width-33,1,ram,2);
+ int ram=(int)((Runtime.getRuntime().freeMemory()*width)/Runtime.getRuntime().totalMemory());
+ g.setColor(Colors.HEAP_TOTAL);
+ g.fillRect(0, title.getVHeight(), width, memMonitorHeight);
+ g.setColor(Colors.HEAP_FREE);
+ g.fillRect(0, title.getVHeight(), ram, memMonitorHeight);
}
}
@@ -534,7 +539,7 @@
// если нижний край ниже окна, выровнять по низу
if (bottom>win_top) win_top=bottom;
}
- // случай, когда курсор больше окна, и он НИЖЕ окна
+ // случай, когда курсор больше окна, и он Н?ЖЕ окна
if (top>=win_top+winHeight) win_top=top;
} catch (Exception e) { e.printStackTrace(); }
}
@@ -619,12 +624,17 @@
* @param keyCode код нажатой кнопки
*/
private void key(int keyCode) {
+ if (keyCode==KEY_STAR) System.gc(); //works good only with static heap!!!
switch (keyCode) {
case 0: break;
case NOKIA_PEN: { destroyView(); break; }
case MOTOE680_VOL_UP:
case KEY_NUM1: { moveCursorHome(); break; }
case KEY_NUM7: { moveCursorEnd(); break; }
+ //
+ case KEY_NUM2: { keyUp(); break; }
+ case KEY_NUM8: { keyDwn(); break; }
+ //
case '5':{ eventOk(); break; }
case MOTOROLA_FLIP: { userKeyPressed(keyCode); break; }
case SIEMENS_RIGHT_SOFT: { if (Version.getPlatformName().startsWith("SIE")) { destroyView(); break; }}
@@ -824,7 +834,7 @@
}
/**
- * событие "Нажатие ЗЕЛЁНОЙ КНОПКИ"
+ * событие "Нажатие ЗЕЛЁНОЙ КНОПК?"
* в классе VirtualList функция выполняет вызов eventOk().
* возможно переопределить (override) функцию для реализации необходимых действий
*/
Index: bombus-plus/export/trunk/src/ui/controls/ScrollBar.java
===================================================================
--- bombus-plus/export/trunk/src/ui/controls/ScrollBar.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/controls/ScrollBar.java (working copy)
@@ -37,7 +37,7 @@
*/
public class ScrollBar {
- private static final int WIDTH_SCROLL_1 =4;
+ private static final int WIDTH_SCROLL_1 =/*4* <*voffk>*/ 3;
private static final int WIDTH_SCROLL_2 =10;
private int yTranslate;
Index: bombus-plus/export/trunk/src/ui/controls/TextFieldCombo.java
===================================================================
--- bombus-plus/export/trunk/src/ui/controls/TextFieldCombo.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/controls/TextFieldCombo.java (working copy)
@@ -35,12 +35,15 @@
import java.util.Vector;
import javax.microedition.lcdui.*;
import locale.SR;
+//#ifdef CLIPBOARD
+//# import Client.Config;
+//# import util.ClipBoard; //
+//#endif
/**
*
* @author Evg_S
*/
-//#if (!MIDP1)
public class TextFieldCombo
extends TextField
implements ItemCommandListener, CommandListener
@@ -50,6 +53,9 @@
private Command cmdBack;
private Command cmdSelect;
private Command cmdClear;
+//#ifdef CLIPBOARD
+//# private Command cmdPaste;
+//#endif
private Display display;
private Displayable parentView;
@@ -79,6 +85,14 @@
cmdRecent=new Command(SR.MS_RECENT, Command.ITEM, 2);
addCommand(cmdRecent);
+
+//#ifdef CLIPBOARD
+//# if (Config.getInstance().useClipBoard) {
+//# cmdPaste=new Command(SR.MS_PASTE, Command.SCREEN, 3);
+//# addCommand(cmdPaste);
+//# }
+//#endif
+
setItemCommandListener(this);
}
@@ -87,7 +101,7 @@
int i=0;
if (result.length()==0) return result;
while (i9 ) recentList.removeElementAt(i);
+ if ( result.equals((String)recentList.elementAt(i)) || i>14 ) recentList.removeElementAt(i);
else i++;
}
recentList.insertElementAt(result, 0);
@@ -96,6 +110,15 @@
}
public void commandAction(Command command, Item item) {
+//#ifdef CLIPBOARD
+//# if (command==cmdPaste) {
+//# if (!ClipBoard.getInstance().isEmpty()) {
+//# this.setString(this.getString()+ClipBoard.getInstance().getClipBoard());
+//# }
+//# return;
+//# }
+//#endif
+
if (recentList.isEmpty()) return;
parentView=display.getCurrent();
@@ -117,6 +140,7 @@
public void commandAction(Command command, Displayable displayable) {
display.setCurrent(parentView);
+
if (command==cmdSelect) {
setString( list.getString(list.getSelectedIndex()));
}
@@ -139,7 +163,7 @@
}
private void loadRecentList() {
- recentList=new Vector(10);
+ recentList=new Vector(15); //<*voffk>
try {
DataInputStream is=NvStorage.ReadFileRecord(id, 0);
@@ -151,16 +175,4 @@
public static void setLowerCaseLatin(TextField tf) {
tf.setInitialInputMode("MIDP_LOWERCASE_LATIN");
}
-}
-//#else
-//# public class TextFieldCombo
-//# extends TextField
-//# {
-//#
-//# /** Creates a new instance of TextFieldCombo */
-//# public TextFieldCombo(String label, String value, int maxlen, int constraints, String id, Display display) {
-//# super(label, value, maxlen, constraints);
-//# }
-//#
-//# }
-//#endif
+}
\ No newline at end of file
Index: bombus-plus/export/trunk/src/ui/controls/NumberField.java
===================================================================
--- bombus-plus/export/trunk/src/ui/controls/NumberField.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/controls/NumberField.java (working copy)
@@ -34,7 +34,7 @@
//#endif
import javax.microedition.lcdui.TextField;
import locale.SR;
-import ui.ConstMIDP;
+//import ui.ConstMIDP;
/**
*
@@ -53,7 +53,7 @@
/** Creates a new instance of SignNumberField */
public NumberField(String label, int initValue, int minValue, int maxValue) {
super(label, String.valueOf(initValue), 6,
- (minValue<0)?ConstMIDP.TEXTFIELD_DECIMAL:NUMERIC );
+ (minValue<0)?TextField.DECIMAL:NUMERIC ); //
this.initValue=initValue;
this.minValue=minValue;
this.maxValue=maxValue;
Index: bombus-plus/export/trunk/src/ui/SplashScreen.java
===================================================================
--- bombus-plus/export/trunk/src/ui/SplashScreen.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/SplashScreen.java (working copy)
@@ -114,8 +114,10 @@
}
public void setProgress(String caption, int progress){
capt=caption;
+//#if DEBUG
System.out.println(capt);
- setProgress(progress);
+//#endif
+ setProgress(progress);
}
public int getProgress(){
return pos;
Index: bombus-plus/export/trunk/src/ui/Time.java
===================================================================
--- bombus-plus/export/trunk/src/ui/Time.java (revision 1363)
+++ bombus-plus/export/trunk/src/ui/Time.java (working copy)
@@ -26,6 +26,7 @@
*/
package ui;
+import Client.Config; //
import java.util.*;
/**
@@ -117,21 +118,94 @@
private final static int[] ofsFieldsB=
{ 0, 5, 8, 11, 14, 17 } ;//XEP-0203
- public static long dateIso8601(String sdate){
+ private final static int[] BombusDateTimeFields= //<+voffk: parsing strings like "dd.mm.yy hh:mm">
+ { 6, 3, 0, 9, 12, 14 };
+
+ public static long dateIso8601(String sdate){ //<*voffk>
int[] ofs=ofsFieldsA;
- if (sdate.endsWith("Z")) ofs=ofsFieldsB;
-
+ int l=4; // yearlen
+ if (sdate.endsWith("Z")) {
+ ofs=ofsFieldsB;
+ }
+ if (sdate.length()==14) {
+ ofs=BombusDateTimeFields;
+ l=2; // yearlen
+ }
try {
- int l=4; // yearlen
for (int i=0; i
+ long utcDate=utcTimeMillis();
+ return timeLocalString(utcDate);
+ }
+
+ public static String localDate(){//
+ long utcDate=utcTimeMillis();
+ return dayLocalString(utcDate);
+ }
+
+ public static String secDiffToDate(int seconds){//
+ String result ="";
+ int d = 0,h = 0,m = 0,s = 0;
+ if (seconds>86400){
+ d=(seconds/86400);
+ seconds=seconds-(d*86400);
+ }
+ if (seconds>3600){
+ h=(seconds/3600);
+ seconds=seconds-(h*3600);
+ }
+ if (seconds>60){
+ m=(seconds/60);
+ seconds=seconds-(m*60);
+ }
+ s=seconds;
+
+ if (d>0) {
+ result+= d + " " + goodWordForm (d,3);
+ }
+ if (h>0) {
+ if (d>0) result+=", ";
+ result+= h + " " + goodWordForm (h, 2);
+ }
+ if (m>0) {
+ if ((d>0) || (h>0)) result+=", ";
+ result+= m + " " + goodWordForm (m, 1);
+ }
+ if (s>0) {
+ if ((d>0) || (h>0) || (m>0)) result+=", ";
+ result+= s + " " + goodWordForm (s, 0);
+ }
+ if (result=="" && s==0)
+ result=s + " " + goodWordForm (s, 0);
+ return result;
+ }
+
+ public static String goodWordForm (int d, int field) {//
+ String [][] suf = {
+ {"second", "seconds", "seconds_"},
+ {"minute", "minutes", "minutes_"},
+ {"hour", "hours", "hours_"},
+ {"day", "days", "days_"},
+ };
+ int index;
+ if ((d%100>10) && (d%100<20) || (d%10==0) || (d%10>4))
+ index=2;
+ else if ((d%10>1) && (d%10<5))
+ index=1;
+ else
+ index=0;
+ return suf[field][index];
+ }
}
-
Index: bombus-plus/export/trunk/src/util/strconv.java
===================================================================
--- bombus-plus/export/trunk/src/util/strconv.java (revision 1363)
+++ bombus-plus/export/trunk/src/util/strconv.java (working copy)
@@ -253,4 +253,49 @@
return out.toString();
}
+
+ public static String stringReplace(String text, String search, String dest){ //
+ /*int pos = 0;
+ int start_pos;
+ int lgn = search.length();
+ if (src.indexOf(search)>-1) {
+ while (true) {
+ start_pos=src.indexOf(search,pos);
+ pos=start_pos;
+ if (start_pos>-1) {
+ String end=src.substring(pos+lgn);
+ String start=src.substring(0, pos);
+ src=start+dest+end;
+ } else {
+ break;
+ }
+ pos=start_pos+lgn;
+ }
+ }
+ return src;
+ }*/
+ String result=text;
+ if (result!=null && result.length()>0) {
+ int startpos=0;
+ int pos=0;
+ while (true) {
+ startpos=result.indexOf(search, pos);
+ if (startpos!=-1) {
+ result=result.substring(0, startpos)+dest+result.substring(startpos+search.length());
+ pos=startpos+dest.length();
+ } else
+ break;
+ }
+ }
+ return result;
+ }
+
+ private static String[] chars= { "?", "\\", "/", "*", ".", "\"" , ":", "%", "@", "|", "<", ">", "COM", "LPT", "NULL", "PRINT"}; //
+
+ public static String replaceBadChars (String src) {//
+ for (int i=0; i
+//#ifdef XML_CONSOLE
+//# import xml.console.StanzasList;
+//#endif
/**
* The dispatcher for blocks that have arrived. Adds new blocks to the
@@ -164,7 +168,9 @@
}
//TODO: reject iq stansas where type =="get" | "set"
}
-
+//#ifdef XML_CONSOLE
+//# StanzasList.getInstance().add(dataBlock.toString(), 10);
+//#endif
} catch (Exception e) {e.printStackTrace();}
}
}
Index: bombus-plus/export/trunk/src/com/alsutton/jabber/JabberStream.java
===================================================================
--- bombus-plus/export/trunk/src/com/alsutton/jabber/JabberStream.java (revision 1363)
+++ bombus-plus/export/trunk/src/com/alsutton/jabber/JabberStream.java (working copy)
@@ -379,6 +379,12 @@
}
//#endif
+//#if TRAFFIC
+//# public int getTrafficBytes() { //<+voffk>
+//# return iostream.getTrafficBytes();
+//# }
+//#endif
+
private class TimerTaskKeepAlive extends TimerTask{
private Timer t;
private int verifyCtr;
@@ -393,7 +399,10 @@
}
public void run() {
try {
+//
+//#if DEBUG
System.out.println("Keep-Alive");
+//#endif
sendKeepAlive(type);
} catch (Exception e) {
Index: bombus-plus/export/trunk/src/com/alsutton/jabber/JabberDataBlock.java
===================================================================
--- bombus-plus/export/trunk/src/com/alsutton/jabber/JabberDataBlock.java (revision 1363)
+++ bombus-plus/export/trunk/src/com/alsutton/jabber/JabberDataBlock.java (working copy)
@@ -34,7 +34,13 @@
public class JabberDataBlock
{
- private final static int MAX_CHILDS=400;
+ private final static int MAX_CHILDS=
+//#if !ReleaseZVOFFK
+ 400;
+//#else
+//# 200; //
+//#endif
+
/**
* The name of this tag
*/
Index: bombus-plus/export/trunk/src/com/jcraft/jzlib/Deflate.java
===================================================================
--- bombus-plus/export/trunk/src/com/jcraft/jzlib/Deflate.java (revision 1363)
+++ bombus-plus/export/trunk/src/com/jcraft/jzlib/Deflate.java (working copy)
@@ -41,7 +41,9 @@
static final private int Z_DEFAULT_COMPRESSION=-1;
-//#ifdef JZLIB_STD_DEFLATE_BUFS
+//
+//#if MAX_COMPRESSION
+//# ///#ifdef JZLIB_STD_DEFLATE_BUFS
//# // that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
//# static final private int MAX_WBITS=15; // 32K LZ77 window
//# static final private int DEF_MEM_LEVEL=8;
Index: bombus-plus/export/trunk/src/com/jcraft/jzlib/Inflate.java
===================================================================
--- bombus-plus/export/trunk/src/com/jcraft/jzlib/Inflate.java (revision 1363)
+++ bombus-plus/export/trunk/src/com/jcraft/jzlib/Inflate.java (working copy)
@@ -35,9 +35,14 @@
package com.jcraft.jzlib;
final class Inflate{
-
- static final public int MAX_WBITS=15; // 32K LZ77 window
+//
+//#if !(MAX_COMPRESSION)
+ static final public int MAX_WBITS=15; // 32K LZ77 window
+//#else
+//# static final private int MAX_WBITS=15; // 32K LZ77 window
+//#endif
+
// preset dictionary flag in zlib header
static final private int PRESET_DICT=0x20;
Index: bombus-plus/export/trunk/src/com/jcraft/jzlib/ZStream.java
===================================================================
--- bombus-plus/export/trunk/src/com/jcraft/jzlib/ZStream.java (revision 1363)
+++ bombus-plus/export/trunk/src/com/jcraft/jzlib/ZStream.java (working copy)
@@ -36,9 +36,15 @@
final public class ZStream{
+//
+//#if !(MAX_COMPRESSION)
//static final private int MAX_WBITS=15; // 32K LZ77 window
//static final private int DEF_WBITS=MAX_WBITS;
-
+//#else
+//# static final private int MAX_WBITS=15; // 32K LZ77 window
+//# static final private int DEF_WBITS=MAX_WBITS;
+//#endif
+
static final private int Z_NO_FLUSH=0;
static final private int Z_PARTIAL_FLUSH=1;
static final private int Z_SYNC_FLUSH=2;
@@ -77,12 +83,23 @@
public long adler;
Adler32 _adler=new Adler32();
+//
+//#if !(MAX_COMPRESSION)
public int inflateInit(){
return inflateInit(Inflate.MAX_WBITS);
}
public int inflateInit(boolean nowrap){
return inflateInit(Inflate.MAX_WBITS, nowrap);
}
+//#else
+//# public int inflateInit(){
+//# return inflateInit(MAX_WBITS);
+//# }
+//# public int inflateInit(boolean nowrap){
+//# return inflateInit(MAX_WBITS, nowrap);
+//# }
+//#endif
+
public int inflateInit(int w){
return inflateInit(w, false);
}
@@ -113,12 +130,23 @@
return istate.inflateSetDictionary(this, dictionary, dictLength);
}
+//
+//#if !(MAX_COMPRESSION)
public int deflateInit(int level){
return deflateInit(level, Deflate.MAX_WBITS);
}
public int deflateInit(int level, boolean nowrap){
return deflateInit(level, Deflate.MAX_WBITS, nowrap);
}
+//#else
+//# public int deflateInit(int level){
+//# return deflateInit(level, MAX_WBITS);
+//# }
+//# public int deflateInit(int level, boolean nowrap){
+//# return deflateInit(level, MAX_WBITS, nowrap);
+//# }
+//#endif
+
public int deflateInit(int level, int bits){
return deflateInit(level, bits, false);
}
@@ -162,8 +190,7 @@
next_out.length<=next_out_index ||
dstate.pending_buf.length<(dstate.pending_out+len) ||
next_out.length<(next_out_index+len)){
- System.out.println(dstate.pending_buf.length+", "+dstate.pending_out+
- ", "+next_out.length+", "+next_out_index+", "+len);
+ System.out.println(dstate.pending_buf.length+", "+dstate.pending_out+", "+next_out.length+", "+next_out_index+", "+len);
System.out.println("avail_out="+avail_out);
}*/
Index: bombus-plus/export/trunk/src/midlet/Bombus.java
===================================================================
--- bombus-plus/export/trunk/src/midlet/Bombus.java (revision 1363)
+++ bombus-plus/export/trunk/src/midlet/Bombus.java (working copy)
@@ -118,15 +118,21 @@
s.setProgress(23);
sd.roster=new Roster(display);
-
+ //
+ if (cf.accountSelect && !cf.autoLogin) {
+ s.close();
+ new AccountSelect(display, true);
+ }
+ else {
if (!selAccount) {
// connect whithout account select
- boolean autologin=cf.autoLogin;
- selAccount=(Account.loadAccount(autologin)==null);
- if (!autologin) s.close();
+ //boolean autologin=cf.autoLogin;
+ selAccount=(Account.loadAccount(cf.autoLogin)==null );
+ if (!cf.autoLogin) s.close();
+ } else { new AccountSelect(display, true); }
}
- if (selAccount) { new AccountSelect(display, true); }
}
+ //
/**
* Destroy must cleanup everything not handled by the garbage collector.
Index: bombus-plus/export/trunk/src/Client/AutoStatusTask.java
===================================================================
--- bombus-plus/export/trunk/src/Client/AutoStatusTask.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/AutoStatusTask.java (working copy)
@@ -63,7 +63,7 @@
if (timeEvent==0) continue;
long timeRemained=System.currentTimeMillis()-timeEvent;
-//#if DefaultConfiguration
+//#if DEBUG
System.out.println(timeRemained);
//#endif
if (timeRemained<0) continue;
Index: bombus-plus/export/trunk/src/Client/ContactEdit.java
===================================================================
--- bombus-plus/export/trunk/src/Client/ContactEdit.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/ContactEdit.java (working copy)
@@ -30,7 +30,10 @@
import javax.microedition.lcdui.*;
import java.util.*;
import locale.SR;
-import ui.ConstMIDP;
+//import ui.ChoiceGroup.POPUP; //
+//#if CLIPBOARD
+//# import ui.controls.TextFieldEx; //
+//#endif
/**
*
@@ -79,15 +82,22 @@
cf=Config.getInstance();
f=new Form(SR.MS_ADD_CONTACT);
-
+
+//#if CLIPBOARD
+//# tJid=new TextFieldEx(SR.MS_USER_JID, null, 150, TextField.EMAILADDR);
+//#
+//# tNick=new TextFieldEx(SR.MS_NAME, null, 32, TextField.ANY);
+//# tGroup=new TextFieldEx(SR.MS_GROUP ,null, 32, TextField.ANY);
+//#else
tJid=new TextField(SR.MS_USER_JID, null, 150, TextField.EMAILADDR);
tNick=new TextField(SR.MS_NAME, null, 32, TextField.ANY);
tGroup=new TextField(SR.MS_GROUP ,null, 32, TextField.ANY);
+//#endif
- tGrpList=new ChoiceGroup(SR.MS_GROUP , ConstMIDP.CHOICE_POPUP);
- tTranspList=new ChoiceGroup(SR.MS_TRANSPORT, ConstMIDP.CHOICE_POPUP);
+ tGrpList=new ChoiceGroup(SR.MS_GROUP , ChoiceGroup.POPUP); //
+ tTranspList=new ChoiceGroup(SR.MS_TRANSPORT, ChoiceGroup.POPUP); //
tAskSubscrCheckBox=new ChoiceGroup(SR.MS_SUBSCRIPTION, ChoiceGroup.MULTIPLE);
tAskSubscrCheckBox.append(SR.MS_ASK_SUBSCRIPTION, null);
@@ -272,12 +282,16 @@
StringBuffer jidBuf=new StringBuffer(jid);
int at=jid.indexOf('@');
- if (at<0) at=tJid.size();
-
- jidBuf.setLength(at);
+ //
+ if (at>=0) {
+ jidBuf.deleteCharAt(at);
+ jidBuf.insert(at, '%');
+ }
jidBuf.append('@');
jidBuf.append(transport);
tJid.setString(jidBuf.toString());
+ jidBuf=null;
+ //
}
if (item==tJid) {
String s1=tJid.getString();
Index: bombus-plus/export/trunk/src/Client/Config.java
===================================================================
--- bombus-plus/export/trunk/src/Client/Config.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/Config.java (working copy)
@@ -51,11 +51,6 @@
public final static int AWAY_OFF=0;
public final static int AWAY_LOCK=1;
public final static int AWAY_IDLE=2;
-
- public final static int SUBSCR_AUTO=0;
- public final static int SUBSCR_ASK=1;
- public final static int SUBSCR_DROP=2;
- public final static int SUBSCR_REJECT=3;
public final int vibraLen=getIntProperty("vibra_len",500);
@@ -67,12 +62,12 @@
public int socketRCVBUF=getIntProperty("RCVBUF",-1);
public int socketSNDBUF=getIntProperty("SNDBUF",-1);*/
- public boolean ghostMotor=getBooleanProperty("moto_e398",false);
+ public boolean ghostMotor=false;//getBooleanProperty("moto_e398",false);
public boolean blFlash=!ghostMotor; //true;
- public boolean msgLog=getBooleanProperty("msg_log",false);
+ //public boolean msgLog=getBooleanProperty("msg_log",false); //
- public boolean muc119=getBooleanProperty("muc_119",true); // before muc 1.19 use muc#owner instead of muc#admin
+ //public boolean muc119=getBooleanProperty("muc_119",true); // before muc 1.19 use muc#owner instead of muc#admin //
public int soundsMsgIndex=0;
@@ -81,28 +76,14 @@
public int soundVol=100;
-//#if !(MIDP1)
public char keyLock=getCharProperty("key_lock",'*');
public char keyVibra=getCharProperty("key_vibra",'#');
-//#else
-//# public boolean msgLogPresence=getBooleanProperty("msg_log_presence",false);
-//# public boolean msgLogConfPresence=getBooleanProperty("msg_log_conf_presence",false);
-//# public boolean msgLogConf=getBooleanProperty("msg_log_conf",false);
-//# public final String msgPath=getStringProperty("msg_log_path","");
-//# public final String siemensCfgPath=getStringProperty("cfg_path","");
-//# public char keyLock=getCharProperty("key_lock",'#');
-//# public char keyVibra=getCharProperty("key_vibra",'*');
-//#endif
- public char keyHide=getCharProperty("key_hide",'9');
+ //public char keyHide=getCharProperty("key_hide",'9');
public char keyOfflines=getCharProperty("key_offlines",'0');
+
+ //public String defGcRoom=getStringProperty("gc_room","bombus@conference.jabber.ru"); //
-//#if USE_LED_PATTERN
-//# public int m55LedPattern=0;
-//#endif
-
- public String defGcRoom=getStringProperty("gc_room","bombus@conference.jabber.ru");
-
//public String xmlLang=getStringProperty("xml_lang",null);
// non-volatile values
@@ -112,27 +93,31 @@
public int def_profile=0;
public boolean smiles=true;
public boolean showOfflineContacts=true;
+//#if !ReleaseZVOFFK
public boolean showTransports=true;
- public boolean selfContact=false;
+ public boolean selfContact=true;
+ public boolean notInListPresences=true;
+//#endif
//public boolean notInList=true;
- public int notInListDropLevel=NotInListFilter.ALLOW_ALL; //enable all
+ //public int notInListDropLevel=NotInListFilter.ALLOW_ALL; //enable all //
public boolean ignore=false;
- public boolean eventComposing=true;
+ public boolean eventComposing=false;
public boolean eventDelivery=true;
public boolean storeConfPresence=true;
- public boolean autoLogin=true;
+ public boolean autoLogin=false;
public boolean autoJoinConferences=false;
- public boolean autoFocus=true;
+ public boolean autoFocus=false;
+
public int gmtOffset;
public int locOffset;
public boolean popupFromMinimized=true;
- public boolean memMonitor;
+ public boolean memMonitor=true; //<*voffk>
public int font1=0;
public int font2=0;
@@ -144,17 +129,50 @@
public boolean capsState=false; //FS#748
public int textWrap=0;
- public int autoSubscribe=SUBSCR_ASK;
+ public boolean autoSubscribe=false;
public int autoAwayType=0;
public int autoAwayDelay=5; //5 minutes
public boolean enableVersionOs=true;
- public int messageCollapsedLength=512;
+ public int messageCollapsedLength=1000; //<*voffk>
- public boolean enablePep=true;
+ //public boolean enablePep=true;
+ //
+//#ifdef PEP
+ public boolean enableMood=true;
+ //#if PEP_TUNE
+ public boolean enableTune=false;
+ //#endif
+//#endif
+
+ public boolean lastAppearedContacts=false;
+ public int def_status=0;
+ public int maxReconnect=10;
+ public boolean useTabs=true;
+ public boolean confirmDelete=true;
+ public boolean autoScroll=false;
+ public boolean accountSelect=false;
+
+//#if ARCHIVE_ADVANCED
+ public boolean cp1251=true;
+//#endif
+
+//#if TRAFFIC
+//# public boolean counterTraffic=false;
+//#endif
+
+//#if LIGHT_CONTROL
+//# public boolean lightState=false;
+//#endif
+
+//#if CLIPBOARD
+//# public boolean useClipBoard = true;
+//#endif
+ //
+
// runtime values
public boolean allowMinimize=false;
public int profile=0;
@@ -173,7 +191,7 @@
// because using of NvStorage methods depending on Config.getInstance()
instance.loadFromStorage();
//#ifdef PEP
- if (instance.enablePep) {
+ if (instance.enableMood) { //
//prefetch
MoodIcons.getInstance();
}
@@ -227,11 +245,13 @@
greenKeyCode=VirtualList.MOTOROLA_GREEN;
VirtualList.keyClear=0x1000;
}
-
- if (platform.indexOf("9@9")>0) {
- istreamWaiting=false; //is it critical for phillips xenium?
- }
- /*if (platform.startsWith("j2me")) {
+ //
+//#if !ZLIB
+//# if (platform.indexOf("9@9")>0) {
+//# istreamWaiting=false; //is it critical for phillips xenium?
+//# }
+//#endif
+ /*if (platform.startsWith("j2me")) {
greenKeyCode=VirtualList.MOTOROLA_GREEN;
VirtualList.keyClear=0x1000;
VirtualList.keyVolDown=VirtualList.MOTOE680_VOL_DOWN;
@@ -244,10 +264,6 @@
}
VirtualList.greenKeyCode=greenKeyCode;
-//#if USE_LED_PATTERN
-//# if (platform.startsWith("M55"))
-//# m55LedPattern=getIntProperty("led_pattern",5);
-//#endif
}
protected void loadFromStorage(){
@@ -258,9 +274,9 @@
fullscreen=inputStream.readBoolean();
def_profile = inputStream.readInt();
smiles=inputStream.readBoolean();
- showTransports=inputStream.readBoolean();
- selfContact=inputStream.readBoolean();
- /*notInList=*/ inputStream.readBoolean();
+ /*showTransports=inputStream.readBoolean();
+ selfContact=inputStream.readBoolean(); */ //
+ // /*notInList=*/ inputStream.readBoolean(); */
ignore=inputStream.readBoolean();
eventComposing=inputStream.readBoolean();
@@ -268,24 +284,24 @@
locOffset=inputStream.readInt();
soundsMsgIndex=inputStream.readInt();
- soundVol=inputStream.readInt();
-
+ soundVol=inputStream.readInt(); //
+
autoLogin=inputStream.readBoolean();
autoJoinConferences=inputStream.readBoolean();
- notInListDropLevel=inputStream.readInt();
+ //notInListDropLevel=inputStream.readInt();
popupFromMinimized=inputStream.readBoolean();
blFlash=inputStream.readBoolean();
- memMonitor=inputStream.readBoolean();
+ //memMonitor=inputStream.readBoolean();
font1=inputStream.readInt();
font2=inputStream.readInt();
autoFocus=inputStream.readBoolean();
- colorTheme=inputStream.readInt();
+ messageCollapsedLength=inputStream.readInt();
storeConfPresence=inputStream.readBoolean();
@@ -293,7 +309,7 @@
textWrap=inputStream.readInt();
- enablePep=inputStream.readBoolean();
+ autoSubscribe=inputStream.readBoolean();
autoAwayType=inputStream.readInt();
autoAwayDelay=inputStream.readInt();
@@ -304,10 +320,70 @@
eventDelivery=inputStream.readBoolean();
- messageCollapsedLength=inputStream.readInt();
+ lastAppearedContacts=inputStream.readBoolean(); //
+
+//#if TRAFFIC
+//# counterTraffic=inputStream.readBoolean(); //
+//#else
+ inputStream.readBoolean();
+//#endif
+
+ colorTheme=inputStream.readInt();
+
+ def_status=inputStream.readInt(); //
+
+ maxReconnect=inputStream.readInt(); //
- autoSubscribe=inputStream.readInt();
+//#if ARCHIVE_ADVANCED
+ cp1251=inputStream.readBoolean(); //
+//#else
+//# inputStream.readBoolean();
+//#endif
+
+//#if LIGHT_CONTROL
+//# lightState=inputStream.readBoolean(); //
+//#else
+ inputStream.readBoolean();
+//#endif
+
+//#if !ReleaseZVOFFK
+ notInListPresences=inputStream.readBoolean();
+ showTransports=inputStream.readBoolean();
+ selfContact=inputStream.readBoolean();
+//#else
+//# inputStream.readBoolean();
+//# inputStream.readBoolean();
+//# inputStream.readBoolean();
+//#endif
+ useTabs=inputStream.readBoolean(); //
+
+//#if PEP
+ enableMood=inputStream.readBoolean();
+ //#if PEP_TUNE
+ enableTune=inputStream.readBoolean();
+ //#else
+//# inputStream.readBoolean();
+ //#endif
+//#else
+//# inputStream.readBoolean();
+//# inputStream.readBoolean();
+//#endif
+
+//#if CLIPBOARD
+//# useClipBoard=inputStream.readBoolean();
+//#else
+ inputStream.readBoolean();
+//#endif
+
+ confirmDelete=inputStream.readBoolean(); //<+voffk>
+
+ memMonitor=inputStream.readBoolean();
+
+ autoScroll=inputStream.readBoolean(); //<+voffk>
+
+ accountSelect=inputStream.readBoolean(); //<+voffk>
+
inputStream.close();
} catch (Exception e) {
e.printStackTrace();
@@ -326,6 +402,8 @@
messageSndType=(String) files[0].elementAt(soundsMsgIndex);
messagesnd=(String) files[1].elementAt(soundsMsgIndex);
}
+
+//#if !(ReleaseZLITE)
public String langFileName(){
if (lang==null) {
//auto-detecting
@@ -344,6 +422,7 @@
}
return null; //unknown language ->en
}
+//#endif
//#if COLOR_THEMES
public String themeFileName() {
@@ -364,9 +443,9 @@
outputStream.writeBoolean(fullscreen);
outputStream.writeInt(def_profile);
outputStream.writeBoolean(smiles);
- outputStream.writeBoolean(showTransports);
- outputStream.writeBoolean(selfContact);
- outputStream.writeBoolean(true /*notInList*/);
+ /*outputStream.writeBoolean(showTransports);
+ outputStream.writeBoolean(selfContact); */ //
+ //outputStream.writeBoolean(true /*notInList*/);
outputStream.writeBoolean(ignore);
outputStream.writeBoolean(eventComposing);
@@ -374,24 +453,24 @@
outputStream.writeInt(locOffset);
outputStream.writeInt(soundsMsgIndex);
- outputStream.writeInt(soundVol);
+ outputStream.writeInt(soundVol); //
outputStream.writeBoolean(autoLogin);
outputStream.writeBoolean(autoJoinConferences);
- outputStream.writeInt(notInListDropLevel /*keepAlive*/);
+ //outputStream.writeInt(notInListDropLevel /*keepAlive*/);
outputStream.writeBoolean(popupFromMinimized);
outputStream.writeBoolean(blFlash);
- outputStream.writeBoolean(memMonitor);
+ //outputStream.writeBoolean(memMonitor);
outputStream.writeInt(font1);
outputStream.writeInt(font2);
outputStream.writeBoolean(autoFocus);
- outputStream.writeInt(colorTheme);
+ outputStream.writeInt(messageCollapsedLength);
outputStream.writeBoolean(storeConfPresence);
@@ -399,7 +478,7 @@
outputStream.writeInt(textWrap);
- outputStream.writeBoolean(enablePep);
+ outputStream.writeBoolean(autoSubscribe);
outputStream.writeInt(autoAwayType);
outputStream.writeInt(autoAwayDelay);
@@ -410,10 +489,70 @@
outputStream.writeBoolean(eventDelivery);
- outputStream.writeInt(messageCollapsedLength);
+ outputStream.writeBoolean(lastAppearedContacts); //
- outputStream.writeInt(autoSubscribe);
-
+//#if TRAFFIC
+//# outputStream.writeBoolean(counterTraffic); //
+//#else
+ outputStream.writeBoolean(false);
+//#endif
+
+ outputStream.writeInt(colorTheme);
+
+ outputStream.writeInt(def_status); //
+
+ outputStream.writeInt(maxReconnect); //
+
+//#if ARCHIVE_ADVANCED
+ outputStream.writeBoolean(cp1251); //
+//#else
+//# outputStream.writeBoolean(true);
+//#endif
+
+//#if LIGHT_CONTROL
+//# outputStream.writeBoolean(lightState); //
+//#else
+ outputStream.writeBoolean(false);
+//#endif
+
+//#if !ReleaseZVOFFK
+ outputStream.writeBoolean(notInListPresences);
+ outputStream.writeBoolean(showTransports);
+ outputStream.writeBoolean(selfContact);
+//#else
+//# outputStream.writeBoolean(true);
+//# outputStream.writeBoolean(true);
+//# outputStream.writeBoolean(false);
+//#endif
+
+ outputStream.writeBoolean(useTabs); //
+
+//#if PEP
+ outputStream.writeBoolean(enableMood);
+ //#if PEP_TUNE
+ outputStream.writeBoolean(enableTune);
+ //#else
+//# outputStream.writeBoolean(false);
+ //#endif
+//#else
+//# outputStream.writeBoolean(true);
+//# outputStream.writeBoolean(false);
+//#endif
+
+//#if CLIPBOARD
+//# outputStream.writeBoolean(useClipBoard);
+//#else
+ outputStream.writeBoolean(true);
+//#endif
+
+ outputStream.writeBoolean(confirmDelete); //<+voffk>
+
+ outputStream.writeBoolean(memMonitor);
+
+ outputStream.writeBoolean(autoScroll); //<+voffk>
+
+ outputStream.writeBoolean(accountSelect); //<+voffk>
+
} catch (Exception e) { e.printStackTrace(); }
NvStorage.writeFileRecord(outputStream, "config", 0, true);
@@ -452,7 +591,7 @@
return defvalue;
}
- public final boolean getBooleanProperty(final String key, final boolean defvalue) {
+ /*public final boolean getBooleanProperty(final String key, final boolean defvalue) {
try {
String s=Bombus.getInstance().getAppProperty(key);
if (s.equals("true")) return true;
@@ -462,6 +601,6 @@
} catch (Exception e) { }
// возвращает defvalue, если атрибут не существует
return defvalue;
- }
+ }*/
}
Index: bombus-plus/export/trunk/src/Client/SmilePicker.java
===================================================================
--- bombus-plus/export/trunk/src/Client/SmilePicker.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/SmilePicker.java (working copy)
@@ -200,4 +200,14 @@
if (cursor!=lines-1) return;
if (xCursor >= xLastCnt) xCursor=xLastCnt-1;
}
+
+ public void userKeyPressed(int keyCode) {//
+ super.userKeyPressed(keyCode);
+ switch (keyCode) {
+ case KEY_NUM3: super.keyLeft(); break;
+ case KEY_NUM9: super.keyRight(); break;
+ case KEY_NUM4: keyLeft(); break;
+ case KEY_NUM6: keyRight(); break;
+ }
+ }
}
Index: bombus-plus/export/trunk/src/Client/ActiveContacts.java
===================================================================
--- bombus-plus/export/trunk/src/Client/ActiveContacts.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/ActiveContacts.java (working copy)
@@ -91,13 +91,53 @@
new ContactMessageList((Contact)c,display).setParentView(StaticData.getInstance().roster);
}
- public void commandAction(Command c, Displayable d) {
+ public void commandAction(Command c, Displayable d) { //<*voffk>
if (c==cmdCancel) destroyView();
if (c==cmdSelect) eventOk();
}
public void keyPressed(int keyCode) {
- if (keyCode==KEY_NUM3) destroyView();
- else super.keyPressed(keyCode);
+ if (keyCode==KEY_NUM3) {
+ destroyView();
+ }
+ else if (keyCode==keyClear) {
+ ((Contact)getFocusedObject()).purge();
+ }
+ else if (keyCode==KEY_NUM0) {
+ if (getItemCount()<1)
+ return;
+ Contact c=(Contact)getFocusedObject();
+
+ Enumeration i=activeContacts.elements();
+
+ int pass=0; // 0=ищем курсор, 1=ищем
+ while (pass<2) {
+ if (!i.hasMoreElements()) i=activeContacts.elements();
+ Contact p=(Contact)i.nextElement();
+ if (pass==1)
+ if (p.getNewMsgsCount()>0) {
+ focusToContact(p);
+ setRotator();
+ break;
+ }
+ if (p==c) pass++; // полный круг пройден
+ }
+ return;
+ }
+ else if (keyCode==KEY_POUND) {
+ ((Contact)getFocusedObject()).setIncoming(Contact.INC_NONE);
+ redraw();
+ }
+ else super.keyPressed(keyCode);
}
-}
+
+ private void focusToContact(final Contact c) {
+ int index=activeContacts.indexOf(c);
+ if (index>=0)
+ moveCursorTo(index);
+ }
+
+ protected void keyGreen(){
+ eventOk();
+ }
+}
\ No newline at end of file
Index: bombus-plus/export/trunk/src/Client/Roster.java
===================================================================
--- bombus-plus/export/trunk/src/Client/Roster.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/Roster.java (working copy)
@@ -42,6 +42,9 @@
//#endif
import locale.SR;
import login.LoginListener;
+//#if NONSASL_ENABLE
+//# import login.NonSASLAuth;
+//#endif
import login.SASLAuth;
import midlet.Bombus;
import vcard.VCard;
@@ -60,15 +63,20 @@
import PrivacyLists.PrivacySelect;
import Client.Config;
import xmpp.XmppError;
+//
+//#if CAPTCHA
import xmpp.extensions.Captcha;
+//#endif
+import xmpp.IqQueryRoster;
import xmpp.extensions.IqLast;
-import xmpp.IqQueryRoster;
import xmpp.extensions.IqTimeReply;
import xmpp.extensions.IqVersionReply;
import xmpp.extensions.Ping;
//#ifdef PEP
import xmpp.extensions.pep.PepListener;
+import Mood.MoodList;
//#endif
+import util.strconv; //
//import Client.msg.*;
@@ -119,6 +127,20 @@
boolean autoAway;
+//#if ReleaseZVOFFK
+//# private Command cmdActions=new Command(SR.MS_ITEM_ACTIONS, Command.SCREEN, 1);
+//# private Command cmdConference=new Command(SR.MS_CONFERENCE, Command.SCREEN, 2);
+//# private Command cmdStatus=new Command(SR.MS_STATUS_MENU, Command.SCREEN, 3);
+//# private Command cmdAlert=new Command(SR.MS_ALERT_PROFILE_CMD, Command.SCREEN, 8);
+//# private Command cmdActiveContact;//=new Command(SR.MS_ACTIVE_CONTACTS, Command.SCREEN, 3);
+//# private Command cmdArchive=new Command(SR.MS_ARCHIVE, Command.SCREEN, 10);
+//# private Command cmdAdd=new Command(SR.MS_ADD_CONTACT, Command.SCREEN, 12);
+//# private Command cmdTools=new Command(SR.MS_TOOLS, Command.SCREEN, 14);
+//# private Command cmdAccount=new Command(SR.MS_ACCOUNT_, Command.SCREEN, 15);
+//# private Command cmdInfo=new Command(SR.MS_ABOUT, Command.SCREEN, 80);
+//# private Command cmdMinimize=new Command(SR.MS_APP_MINIMIZE, Command.SCREEN, 90);
+//# private Command cmdQuit=new Command(SR.MS_APP_QUIT, Command.SCREEN, 99);
+//#else
private Command cmdActions=new Command(SR.MS_ITEM_ACTIONS, Command.SCREEN, 1);
private Command cmdStatus=new Command(SR.MS_STATUS_MENU, Command.SCREEN, 2);
private Command cmdActiveContact;//=new Command(SR.MS_ACTIVE_CONTACTS, Command.SCREEN, 3);
@@ -131,8 +153,9 @@
private Command cmdInfo=new Command(SR.MS_ABOUT, Command.SCREEN, 80);
private Command cmdMinimize=new Command(SR.MS_APP_MINIMIZE, Command.SCREEN, 90);
private Command cmdQuit=new Command(SR.MS_APP_QUIT, Command.SCREEN, 99);
+//#endif
- private Config cf;
+ /*private Config cf;*/private Config cf=Config.getInstance(); //
private StaticData sd=StaticData.getInstance();
// #if (MOTOROLA_BACKLIGHT)
@@ -143,8 +166,14 @@
private String token;
public long lastMessageTime=Time.utcTimeMillis();
-
- private final static int maxReconnect=5;
+
+ //
+ private String myMessage;
+ private final String TIME_REP="%t";
+ private final String DATE_REP="%d";
+
+ //private final static int maxReconnect=5;
+ //
private int reconnectCount;
private AutoStatusTask autostatus;
@@ -161,9 +190,11 @@
//setTitleImages(StaticData.getInstance().rosterIcons);
this.display=display;
+//#if LIGHT_CONTROL
+//# setLight(cf.lightState);
+//#endif
+ //cf=Config.getInstance();
- cf=Config.getInstance();
-
//canback=false; // We can't go back using keyBack
//msgNotify=new EventNotify(display, Profile.getProfile(0) );
@@ -186,7 +217,7 @@
if (platform.startsWith("Nokia")) activeType=Command.BACK;
if (platform.startsWith("Intent")) activeType=Command.BACK;
- cmdActiveContact=new Command(SR.MS_ACTIVE_CONTACTS, activeType, 3);
+ cmdActiveContact=new Command(SR.MS_ACTIVE_CONTACTS, activeType, 10); // <1>
addCommand(cmdStatus);
addCommand(cmdActions);
@@ -251,6 +282,35 @@
getTitleItem().setElementAt(s, 3);
}
+ /*private void setRosterTitle(){ //
+ StringBuffer title= new StringBuffer();
+ title.append("(");
+ title.append(groups.getRosterOnline());
+ title.append("/");
+ title.append(groups.getRosterContacts());
+ title.append(") ");
+ title.append(Time.localTime());
+ title.append(" ");
+//#if TRAFFIC
+//# if (cf.counterTraffic) {
+//# int bytes=0;
+//# try {
+//# bytes=theStream.getTrafficBytes()*2/1024; //doubling traffic because real traffic is larger
+//# } catch (Exception e) {
+//# bytes=0;
+//# }
+//# title.append(bytes);
+//# title.append(" kb");
+//# } else {
+//# title.append(Time.localDate());
+//# }
+//#else
+ title.append(Time.localDate());
+//#endif
+ setRosterTitle(title.toString());
+ title=null;
+ }*/
+
private int rscaler;
private int rpercent;
@@ -311,7 +371,7 @@
bookmarks=null;
}
setMyJid(new Jid(sd.account.getJid()));
- updateContact(sd.account.getNick(), myJid.getBareJid(), SR.MS_SELF_CONTACT, "self", false);
+ updateContact(sd.account.getNick(), myJid.getBareJid(), /*SR.MS_SELF_CONTACT*/ "self-contacts", "self", false); //
System.gc();
}
@@ -347,8 +407,9 @@
if (transferIcon!=null) return transferIcon;
return messageIcon;
}
-
+
private void updateTitle(){
+ ////setRosterTitle(); //
int s=querysign?RosterIcons.ICON_PROGRESS_INDEX:myStatus;
int profile=cf.profile;//StaticData.getInstance().config.profile;
Object en=(profile>1)? new Integer(profile+RosterIcons.ICON_PROFILE_INDEX):null;
@@ -360,7 +421,7 @@
title.setElementAt(null,1);
} else {
messageIcon=new Integer(RosterIcons.ICON_MESSAGE_INDEX);
- title.setElementAt(" "+messageCount+" ",1);
+ title.setElementAt(" "+messageCount, 1); //
}
title.setElementAt(messageIcon, 0);
}
@@ -374,10 +435,6 @@
}
}
messageCount=m;
-//#if USE_LED_PATTERN
-//-- int pattern=cf.m55LedPattern;
-//-- if (pattern>0) EventNotify.leds(pattern-1, m>0);
-//#endif
updateTitle();
return (m>0);
}
@@ -482,6 +539,11 @@
firstInstance=false;
//end of FS#712 workaround
+ //
+ Group g=c.getGroup();
+ if (g.type!=Groups.TYPE_TRANSP && g.type!=Groups.TYPE_NOT_IN_LIST)
+ g.collapsed=true;
+ //
c.setSortKey((nick==null)? jid:nick);
}
}
@@ -666,11 +728,14 @@
* Method to inform the server we are now online
*/
- public void sendPresence(int newStatus) {
+ public void sendPresence(int newStatus, String message) {
if (newStatus!=Presence.PRESENCE_SAME)
myStatus=newStatus;
+ if (message!=null)
+ myMessage=message;
+
setQuerySign(false);
if (myStatus!=Presence.PRESENCE_OFFLINE) {
lastOnlineStatus=myStatus;
@@ -689,14 +754,23 @@
// send presence
ExtendedStatus es= StatusList.getInstance().getStatus(myStatus);
- Presence presence = new Presence(myStatus, es.getPriority(), es.getMessage(), StaticData.getInstance().account.getNick());
+
+ //
+
if (isLoggedIn()) {
- if (myStatus==Presence.PRESENCE_OFFLINE) groups.queryGroupState(false);
-
+ //if (myStatus==Presence.PRESENCE_OFFLINE) groups.queryGroupState(false);
if (!StaticData.getInstance().account.isMucOnly() )
theStream.send( presence );
- multicastConferencePresence();
+ multicastConferencePresence(myMessage);
// disconnect
if (myStatus==Presence.PRESENCE_OFFLINE) {
@@ -709,6 +783,7 @@
Contact c=(Contact)e.nextElement();
//if (c.myStatus
}
}
@@ -725,11 +800,19 @@
public void sendDirectPresence(int status, String to, JabberDataBlock x) {
if (to==null) {
- sendPresence(status);
+ sendPresence(status, null);
return;
}
ExtendedStatus es= StatusList.getInstance().getStatus(status);
- Presence presence = new Presence(status, es.getPriority(), es.getMessage(), StaticData.getInstance().account.getNick());
+
+ //
+ myMessage=es.getMessage();
+
+ myMessage=strconv.stringReplace(myMessage, TIME_REP, Time.localTime() );
+ myMessage=strconv.stringReplace(myMessage, DATE_REP, Time.localDate() );
+
+ Presence presence = new Presence(status, es.getPriority(), myMessage, StaticData.getInstance().account.getNick());
+ //
presence.setTo(to);
if (x!=null) presence.addChild(x);
@@ -753,7 +836,7 @@
return getContact(myJid.getJid(), false);
}
- public void multicastConferencePresence() {
+ public void multicastConferencePresence(String message) {
if (myStatus==Presence.PRESENCE_INVISIBLE) return; //block multicasting presence invisible
ExtendedStatus es= StatusList.getInstance().getStatus(myStatus);
for (Enumeration e=hContacts.elements(); e.hasMoreElements();) {
@@ -769,7 +852,17 @@
continue;
}
- Presence presence = new Presence(myStatus, es.getPriority(), es.getMessage(), null);
+ //
+ if (message!=null)
+ myMessage=message;
+ else
+ myMessage=es.getMessage();
+
+ myMessage=strconv.stringReplace(myMessage, TIME_REP, Time.localTime() );
+ myMessage=strconv.stringReplace(myMessage, DATE_REP, Time.localDate() );
+ Presence presence = new Presence(myStatus, es.getPriority(), myMessage, null);
+ //
+
presence.setTo(myself.getJid());
theStream.send(presence);
}
@@ -900,6 +993,30 @@
updateTitle();
}
+
+//#if CHANGE_TRANSPORT
+//# public void contactChangeTransport(String srcTransport, String dstTransport){ //
+//# setQuerySign(true);
+//# for (Enumeration e=hContacts.elements(); e.hasMoreElements(); ) {
+//# Contact k=(Contact) e.nextElement();
+//# if (k.jid.isTransport()) continue;
+//# int grpType=k.getGroupType();
+//# if (k.jid.getServer().equals(srcTransport) &&
+//# (grpType==Groups.TYPE_COMMON || grpType==Groups.TYPE_NO_GROUP ||
+//# /*grpType==Groups.TYPE_VISIBLE ||*/ grpType==Groups.TYPE_IGNORE)) {
+//# String jid=k.getJid();
+//# jid=strconv.stringReplace(jid, srcTransport, dstTransport);
+//# storeContact(jid, k.nick, (k.getGroup().getName()!=SR.MS_GENERAL)?(k.getGroup().getName()):"", true); //new contact addition
+//# try {
+//# Thread.sleep(300);
+//# } catch (Exception ex) { }
+//# deleteContact(k); //old contact deletion
+//# }
+//# }
+//# setQuerySign(false);
+//# }
+//#endif
+
/**
* Method to handle an incomming datablock.
*
@@ -934,11 +1051,14 @@
theStream.addBlockListener(new IqTimeReply());
theStream.addBlockListener(new EntityCaps());
theStream.addBlockListener(new Ping());
-
+
//#ifdef PEP
theStream.addBlockListener(new PepListener()); //TODO: dynamic enabling/disabling
-//#endif
+//#endif
+//
+//#if CAPTCHA
theStream.addBlockListener(new Captcha(display));
+//#endif
//enable keep-alive packets
theStream.startKeepAliveTask();
@@ -948,7 +1068,7 @@
// залогинились. теперь, если был реконнект, то просто пошлём статус
if (reconnect) {
querysign=reconnect=false;
- sendPresence(myStatus);
+ sendPresence(myStatus, null); //
return;
}
@@ -987,7 +1107,7 @@
String id=(String) data.getAttribute("id");
if (id!=null) {
-
+
if (id.startsWith("nickvc")) {
if (type.equals("get") || type.equals("set")) return JabberBlockListener.BLOCK_REJECTED;
@@ -1027,13 +1147,13 @@
processRoster(data);
- groups.queryGroupState(true);
+ //groups.requestGroupState(true); //
setProgress(SR.MS_CONNECTED,100);
reEnumRoster();
// теперь пошлём присутствие
querysign=reconnect=false;
- sendPresence(myStatus);
+ sendPresence(myStatus, null); //
//sendPresence(Presence.PRESENCE_INVISIBLE);
SplashScreen.getInstance().close(); // display.setCurrent(this);
@@ -1048,6 +1168,21 @@
if ( type.equals( "result" ) ) {
/*no handlers now*/
} else
+ if (type.equals("get")){
+ Contact c=getContact(from, true); //
+//#if GAMES
+//# JabberDataBlock query=data.getChildBlock("query");
+//# if (query!=null){
+//# if (query.isJabberNameSpace("checkers")) {
+//# c.setCheckers(-6);
+//# theStream.send(new IqCheckers(data, true));
+//# return JabberBlockListener.BLOCK_PROCESSED;
+//# }
+//# return JabberBlockListener.BLOCK_REJECTED;
+//# }
+//#endif
+ }
+
if (type.equals("set")) {
if (processRoster(data)) {
theStream.send(new Iq(from, Iq.TYPE_RESULT, id));
@@ -1122,13 +1257,13 @@
try {
JabberDataBlock xmlns=message.findNamespace("x", "http://jabber.org/protocol/muc#user");
- JabberDataBlock error=xmlns.getChildBlock("error");
+ //JabberDataBlock error=xmlns.getChildBlock("error");
JabberDataBlock invite=xmlns.getChildBlock("invite");
// FS#657
if (invite !=null) {
- if (error!=null ) {
+ if (/*error!=null */message.getTypeAttribute().equals("error")) {
ConferenceGroup invConf=(ConferenceGroup)groups.getGroup(from);
- body=XmppError.decodeStanzaError(error).toString(); /*"error: invites are forbidden"*/
+ body=XmppError.decodeStanzaError(message).toString(); /*"error: invites are forbidden"*/
} else {
String inviteFrom=invite.getAttribute("from");
String inviteReason=invite.getChildBlockText("reason");
@@ -1146,8 +1281,9 @@
}
} catch (Exception e) { /* not muc#user case*/ }
- Contact c=getContact(from, cf.notInListDropLevel != NotInListFilter.DROP_MESSAGES_PRESENCES);
- if (c==null) return JabberBlockListener.BLOCK_REJECTED; //not-in-list message dropped
+ Contact c=getContact(from, true); //
+ /*Contact c=getContact(from, cf.notInListDropLevel != NotInListFilter.DROP_MESSAGES_PRESENCES);
+ if (c==null) return JabberBlockListener.BLOCK_REJECTED; //not-in-list message dropped */ //
if (name==null) name=c.getName();
// /me
@@ -1242,16 +1378,18 @@
if (xmuc!=null) try {
MucContact c = mucContact(from);
-
int rp=from.indexOf('/');
String name=from.substring(rp+1);
from=from.substring(0, rp);
+ ConferenceGroup currentGroup=(ConferenceGroup)groups.getGroup(from); //
+ String myNick=currentGroup.getSelfContact().nick; //
Msg chatPresence=new Msg(
Msg.MESSAGE_TYPE_PRESENCE,
name,
null,
c.processPresence(xmuc, pr) );
if (cf.storeConfPresence ||
+ chatPresence.getBody().indexOf(myNick)>-1 /*voffk*/||
chatPresence.getBody().indexOf(SR.MS_WAS_BANNED)>-1 ||
chatPresence.getBody().indexOf(SR.MS_WAS_KICKED)>-1) {
messageStore(getContact(from, false), chatPresence);
@@ -1264,44 +1402,52 @@
} /* if (muc) */ catch (Exception e) { /*e.printStackTrace();*/ }
else {
//processing presences
- Contact c=null;
+ /*boolean enNIL= cf.notInListDropLevel > NotInListFilter.DROP_PRESENCES;
+ if (ti==Presence.PRESENCE_AUTH_ASK) enNIL=true;
+ Contact c=getContact(from, enNIL);
+ if (c==null) return JabberBlockListener.BLOCK_REJECTED; //drop not-in-list presence */ //
+//#if !ReleaseZVOFFK
+ boolean enNIL=cf.notInListPresences;
+ if (ti==Presence.PRESENCE_AUTH_ASK) enNIL=true;
+ Contact c=getContact(from, enNIL);
+ if (c==null) return JabberBlockListener.BLOCK_REJECTED;
+//#else
+//# Contact c=getContact(from, true);
+//#endif
+
+ messageStore(c, m);
if (ti==Presence.PRESENCE_AUTH_ASK) {
- //processing subscriptions
- if (cf.autoSubscribe==Config.SUBSCR_DROP) return JabberBlockListener.BLOCK_REJECTED;
-
- if (cf.autoSubscribe==Config.SUBSCR_REJECT) {
- //System.out.println(from+": decline subscription");
-
- sendPresence(from, "unsubscribed", null);
- return JabberBlockListener.BLOCK_PROCESSED;
- }
-
- c=getContact(from, true);
- messageStore(c, m);
-
- if (cf.autoSubscribe==Config.SUBSCR_AUTO) {
+ if (cf.autoSubscribe) {
doSubscribe(c);
messageStore(c, new Msg(Msg.MESSAGE_TYPE_AUTH, from, null, SR.MS_AUTH_AUTO));
}
- } else {
- // processing presences
- boolean enNIL= cf.notInListDropLevel > NotInListFilter.DROP_PRESENCES;
- c=getContact(from, enNIL);
-
- if (c==null) return JabberBlockListener.BLOCK_REJECTED; //drop not-in-list presence
-
- messageStore(c, m);
}
c.priority=pr.getPriority();
if (ti>=0) c.setStatus(ti);
- if (c.nick==null && c.status<=Presence.PRESENCE_DND) {
+ if ((c.nick==null && c.status<=Presence.PRESENCE_DND && c.getGroupType()!=Groups.TYPE_TRANSP)) {//
JabberDataBlock nick = pr.findNamespace("nick", "http://jabber.org/protocol/nick");
if (nick!=null) c.nick=nick.getText();
//todo: optionaly update roster
}
+
+ //
+ if (cf.lastAppearedContacts /*&& notifyReady(-111) ///////////////*/ &&
+ (ti==Presence.PRESENCE_ONLINE || ti==Presence.PRESENCE_CHAT)) {
+ if (c.getGroupType()!=Groups.TYPE_TRANSP) c.setIncoming(Contact.INC_APPEARING);
+ }
+ if (ti==Presence.PRESENCE_OFFLINE) {
+ c.setIncoming(Contact.INC_NONE);
+ c.setComposing(false);
+ }
+ /*if (ti>=0) {
+ if ((ti==Presence.PRESENCE_ONLINE || ti==Presence.PRESENCE_CHAT || ti==Presence.PRESENCE_OFFLINE) && (c.getGroupType()!=Groups.TYPE_TRANSP) && (c.getGroupType()!=Groups.TYPE_IGNORE))
+ playNotify(ti);
+ }*/ //////////////////////////////////////
+ //
+
/*if (ti==Presence.PRESENCE_OFFLINE) c.acceptComposing=false;
c.setComposing(false);*/
}
@@ -1315,7 +1461,7 @@
return JabberBlockListener.BLOCK_REJECTED;
}
- boolean processRoster(JabberDataBlock data){
+ boolean processRoster(JabberDataBlock data){
JabberDataBlock q=data.findNamespace("query", "jabber:iq:roster");
if (q==null) return false;
int type=0;
@@ -1392,11 +1538,11 @@
boolean blFlashEn=cf.blFlash; // motorola e398 backlight bug
- switch (profile) {
- case AlertProfile.ALL: notify=new EventNotify(display, type, message, cf.vibraLen, blFlashEn); break;
- case AlertProfile.NONE: notify=new EventNotify(display, null, null, 0, false ); break;
- case AlertProfile.VIBRA: notify=new EventNotify(display, null, null, cf.vibraLen, blFlashEn); break;
- case AlertProfile.SOUND: notify=new EventNotify(display, type, message, 0, blFlashEn); break;
+ switch (profile) {//
+ case AlertProfile.ALL: notify=new EventNotify(display, type, message, volume , cf.vibraLen, blFlashEn); break;
+ case AlertProfile.NONE: notify=new EventNotify(display, null, null, volume , 0, false ); break;
+ case AlertProfile.VIBRA: notify=new EventNotify(display, null, null, volume , cf.vibraLen, blFlashEn); break;
+ case AlertProfile.SOUND: notify=new EventNotify(display, type, message, volume , 0, blFlashEn); break;
}
if (notify!=null) notify.startNotify();
}
@@ -1424,11 +1570,19 @@
//try {
//setProgress(SR.MS_LOGINPGS, 42);
+//#if NONSASL_ENABLE
+//# if (sd.account.isSASL()) {
+//#endif
new SASLAuth(sd.account, SessionId, this, theStream)
- //#if SASL_XGOOGLETOKEN
+//#if SASL_XGOOGLETOKEN
.setToken(token)
- //#endif
+//#endif
;
+//#if NONSASL_ENABLE
+//# } else {
+//# new NonSASLAuth(sd.account, SessionId, this, theStream);
+//# }
+//#endif
}
/**
@@ -1447,7 +1601,7 @@
} else {
try {
- sendPresence(Presence.PRESENCE_OFFLINE);
+ sendPresence(Presence.PRESENCE_OFFLINE, "Disconnected due to error"); //
} catch (Exception e2) {
e2.printStackTrace();
}
@@ -1461,16 +1615,16 @@
e.printStackTrace();
try {
- sendPresence(Presence.PRESENCE_OFFLINE);
+ sendPresence(Presence.PRESENCE_OFFLINE, "Disconnected due to error"); //
} catch (Exception e2) { }
if (e instanceof SecurityException) { errorLog(error); return; }
//if (e instanceof JabberStreamShutdownException) { errorLog(error); return; }
- if (reconnectCount>=maxReconnect) { errorLog(error); return; }
+ if (reconnectCount>=cf.maxReconnect) { errorLog(error); return; } //
//errorLog(error);
{
reconnectCount++;
- String title="("+reconnectCount+"/"+maxReconnect+") Reconnecting";
+ String title="("+reconnectCount+"/"+cf.maxReconnect+") Reconnecting"; //
Msg m=new Msg(Msg.MESSAGE_TYPE_OUT, "local", title, error);
messageStore(selfContact(), m);
@@ -1480,7 +1634,7 @@
}
private int lastOnlineStatus;
public void doReconnect() {
- sendPresence(lastOnlineStatus);
+ sendPresence(lastOnlineStatus, null); //
}
//private VList l;
@@ -1517,13 +1671,13 @@
//System.out.println(keyCode);
super.keyPressed(keyCode);
//#if (MOTOROLA_BACKLIGHT)
- if (cf.ghostMotor) {
- // backlight management
- if (keyCode=='*') blState=(blState==1)? Integer.MAX_VALUE : 1;
- else blState=Integer.MAX_VALUE;
-
- display.flashBacklight(blState);
- }
+//# if (cf.ghostMotor) {
+//# // backlight management
+//# if (keyCode=='*') blState=(blState==1)? Integer.MAX_VALUE : 1;
+//# else blState=Integer.MAX_VALUE;
+//#
+//# display.flashBacklight(blState);
+//# }
//#endif
//workaround for SE JP6 - enabling vibra in closed state
if (keyCode==SE_FLIPCLOSE_JP6) {
@@ -1545,6 +1699,19 @@
if (keyCode!=cf.keyLock) userActivity();
}
+ if (keyCode==KEY_NUM1) { // collapse all groups
+ for (Enumeration e=groups.elements(); e.hasMoreElements();) {
+ Group grp=(Group)e.nextElement();
+ grp.collapsed=true;
+ }
+ reEnumRoster();
+ return;
+ }
+
+ if (keyCode==KEY_POUND) { //
+ if (getFocusedObject() instanceof Contact)
+ ((Contact)getFocusedObject()).setIncoming(Contact.INC_NONE); //removing incoming index
+ }
}
private void userActivity() {
@@ -1586,11 +1753,36 @@
if (keyCode==KEY_NUM3) new ActiveContacts(display, null);
- if (keyCode==cf.keyHide && cf.allowMinimize) {
+ /*if (keyCode==cf.keyHide && cf.allowMinimize) {
Bombus.getInstance().hideApp(true);
+ }*/ //
+
+ //
+ if (keyCode==KEY_NUM9) /*toggleLight();*/ {
+ if (cf.allowMinimize)
+ Bombus.getInstance().hideApp(true);
+ else if (Version.getPlatformName().endsWith("(NSG)")) //SIEMENS-NSG: MYMENU call. Possible Native Menu for capable phones
+ try {
+ Bombus.getInstance().platformRequest("native:NAT_MAIN_MENU");
+ } catch (Exception e) { }
+ else if (Version.getPlatformName().startsWith("SIE")) //SIEMENS: MYMENU call. Possible Main Menu for capable phones
+ try {
+ Bombus.getInstance().platformRequest("native:ELSE_STR_MYMENU");
+ } catch (Exception e) { }
}
- if (keyCode==KEY_NUM9) toggleLight();
+ if (keyCode==KEY_NUM4) new ConfigForm(display);
+
+ if (keyCode==KEY_NUM7) new RosterToolsMenu(display);
+
+ if (!isLoggedIn()) return;
+
+ if (keyCode==KEY_NUM1) new Bookmarks(display, null);
+
+//#if PEP
+ if (keyCode==KEY_NUM6) new MoodList(display);
+//#endif
+ //
}
public void userKeyPressed(int keyCode){
@@ -1627,7 +1819,7 @@
}
- private void toggleLight() {
+ /*private void toggleLight() {
//#ifdef SIEMENS_BACKLIGHT
//# if (Version.getPlatformName().endsWith("(NSG)")) {
//# if (blState!=1){
@@ -1639,12 +1831,30 @@
//# }
//# }
//#endif
- }
+ }*/ //
+//#if LIGHT_CONTROL
+//# public void setLight(boolean state) {
+//# if (Version.getPlatformName().startsWith("SIE") || Version.getPlatformName().endsWith("(NSG)")) {
+//# try {
+//# if (state) {
+//# com.siemens.mp.game.Light.setLightOn();
+//# } else {
+//# com.siemens.mp.game.Light.setLightOff();
+//# }
+//# } catch( Exception e ) { }
+//# }
+//# if (Version.getPlatformName().startsWith("SonyE") || Version.getPlatformName().startsWith("Nokia")) {
+//# LightControl.getInstance().setLight(state);
+//# }
+//# }
+//#endif
+
public void logoff(){
- if (isLoggedIn())
+ if (isLoggedIn() /*&& myStatus!=Presence.PRESENCE_INVISIBLE*/) //kostyl by voffk
try {
- sendPresence(Presence.PRESENCE_OFFLINE);
+ ExtendedStatus es=StatusList.getInstance().getStatus(Presence.PRESENCE_OFFLINE); //
+ sendPresence(Presence.PRESENCE_OFFLINE, es.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
@@ -1655,6 +1865,11 @@
userActivity();
if (c==cmdQuit) {
autostatus.destroyTask();
+//#if LIGHT_CONTROL
+//# if (Version.getPlatformName().startsWith("SonyE") || Version.getPlatformName().startsWith("Nokia")) {
+//# LightControl.getInstance().destroyTask();
+//# }
+//#endif
destroyView();
logoff();
//StaticData sd=StaticData.getInstance();
@@ -1708,12 +1923,18 @@
//confGroup.getConference().status=Presence.PRESENCE_ONLINE;
}
- public void leaveRoom(Group group){
+ public void leaveRoom(Group group){//mod: setting Presence.PRESENCE_OFFLINE for all contacts in conferenceGroup!!!
//Group group=groups.getGroup(index);
ConferenceGroup confGroup=(ConferenceGroup)group;
Contact myself=confGroup.getSelfContact();
confGroup.getConference().commonPresence=false; //disable reenter after reconnect
- sendPresence(myself.getJid(), "unavailable", null);
+ //
+ String myMessage=StatusList.getInstance().getStatus(Presence.PRESENCE_OFFLINE).getMessage();
+ myMessage=strconv.stringReplace(myMessage, TIME_REP, Time.localTime() );
+ myMessage=strconv.stringReplace(myMessage, DATE_REP, Time.localDate() );
+ JabberDataBlock x=new JabberDataBlock(null, "status", myMessage);
+ sendPresence(myself.getJid(), "unavailable", x);////
+ //
//roomOffline(group);
}
@@ -1839,14 +2060,22 @@
}
// self-contact group
Group selfContactGroup=groups.getGroup(Groups.TYPE_SELF);
+//#if !ReleaseZVOFFK
selfContactGroup.visible=(cf.selfContact || selfContactGroup.tonlines>1 || selfContactGroup.unreadMessages>0 );
+//#else
+//# selfContactGroup.visible=true;
+//#endif
// hiddens
groups.getGroup(Groups.TYPE_IGNORE).visible= cf.ignore ;
// transports
Group transpGroup=groups.getGroup(Groups.TYPE_TRANSP);
+//#if !ReleaseZVOFFK
transpGroup.visible= (cf.showTransports || transpGroup.unreadMessages>0);
+//#else
+//# transpGroup.visible=true;
+//#endif
// adding groups
for (i=0; i
setRosterTitle("("+groups.getRosterOnline()+"/"+groups.getRosterContacts()+")");
+ ////setRosterTitle();
+ // see also updateTitle()
//resetStrCache();
if (cursor<0) cursor=0;
@@ -1883,13 +2115,26 @@
if (!isLoggedIn()) return;
if (status==Presence.PRESENCE_ONLINE && autoAway) {
autoAway=false;
- sendPresence(Presence.PRESENCE_ONLINE);
+ sendPresence(Presence.PRESENCE_ONLINE, null); //
return;
}
- if (status!=Presence.PRESENCE_ONLINE && myStatus==Presence.PRESENCE_ONLINE && !autoAway) {
+ if (status!=Presence.PRESENCE_ONLINE && (myStatus==Presence.PRESENCE_ONLINE || myStatus==Presence.PRESENCE_CHAT) && !autoAway) {//
autoAway=true;
- sendPresence(Presence.PRESENCE_AWAY);
+ sendPresence(Presence.PRESENCE_AWAY, "Auto-away after "+cf.autoAwayDelay+" min."); /////////
}
}
}
+
+/*public void setAutoAway() {
+ if (!autoAway && cf.autoAwayType==cf.AWAY_IDLE) {
+ oldStatus=myStatus;
+ autoAway=true;
+ if (cf.setAutoStatusMessage) {
+ sendPresence(Presence.PRESENCE_AWAY, SR.MS_AUTO_AWAY);
+ } else {
+ sendPresence(Presence.PRESENCE_AWAY, null);
+ }
+ }
+ }
+*/
\ No newline at end of file
Index: bombus-plus/export/trunk/src/Client/RosterItemActions.java
===================================================================
--- bombus-plus/export/trunk/src/Client/RosterItemActions.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/RosterItemActions.java (working copy)
@@ -27,7 +27,7 @@
package Client;
-import Conference.ConferenceForm;
+//import Conference.ConferenceForm;
import Conference.ConferenceGroup;
import Conference.affiliation.ConferenceQuickPrivelegeModify;
import Conference.InviteForm;
@@ -50,6 +50,17 @@
import ui.YesNoAlert;
import vcard.VCard;
import vcard.vCardForm;
+//
+import xmpp.extensions.IqLast;
+import xmpp.extensions.IqTimeReply;
+//#ifdef CLIPBOARD
+//# import util.ClipBoard;
+//#endif
+//#if GAMES
+//# import games.Checkers;
+//# import com.alsutton.jabber.datablocks.IqCheckers;
+//#endif
+//
/**
*
@@ -62,10 +73,20 @@
Object item;
Roster roster;
+
+//#ifdef CLIPBOARD
+//# private ClipBoard clipboard; //
+//#endif
+
/** Creates a new instance of RosterItemActions */
public RosterItemActions(Display display, Object item, int action) {
super(item.toString());
+//#ifdef CLIPBOARD
+//# if (Config.getInstance().useClipBoard)
+//# clipboard=ClipBoard.getInstance();
+//#endif
+
roster=StaticData.getInstance().roster;
if (!roster.isLoggedIn()) return;
@@ -81,21 +102,52 @@
addItem(SR.MS_LOGON,5);
addItem(SR.MS_LOGOFF,6);
addItem(SR.MS_RESOLVE_NICKNAMES, 7);
+//#if CHANGE_TRANSPORT
+//# addItem(SR.MS_REPLACE_TRANSPORT, 110); //
+//#endif
}
//if (contact.group==Groups.SELF_INDEX) addItem("Commands",30);
- addItem(SR.MS_VCARD,1);
- addItem(SR.MS_CLIENT_INFO,0);
- addItem(SR.MS_COMMANDS,30);
+ //
+ addItem(SR.MS_CLIENT_INFO,0);
+ addItem(SR.MS_VCARD,1);
if (contact.getGroupType()!=Groups.TYPE_SELF && contact.getGroupType()!=Groups.TYPE_SEARCH_RESULT && contact.origin
+
if (contact.origin==Contact.ORIGIN_GROUPCHAT) return; //TODO: подключить тот же список, что и для ConferenceGroup
if (contact instanceof MucContact) {
@@ -273,7 +325,13 @@
roster.resolveNicknames(c.getBareJid());
break;
}
-
+//#if CHANGE_TRANSPORT
+//# case 110: // change transport
+//# {
+//# new ChangeTransport(display, c.getBareJid());
+//# return;
+//# }
+//#endif
case 21:
{
roster.cleanupSearch();
@@ -304,6 +362,61 @@
return;
}
//#endif
+ case 100: // previous status
+ {
+ roster.setQuerySign(true);
+ roster.theStream.send(IqLast.query(c.getBareJid()));
+ break;
+ }
+
+ case 101: // idle
+ {
+ roster.setQuerySign(true);
+ roster.theStream.send(IqLast.query(c.getJid()));
+ break;
+ }
+
+ case 102: // time
+ {
+ roster.setQuerySign(true);
+ roster.theStream.send(IqTimeReply.query(c.getJid()));
+ break;
+ }
+
+//#ifdef CLIPBOARD
+//# case 105: //Copy JID
+//# {
+//# if (!(c instanceof MucContact)) {
+//# //System.out.println("1 c "+c.bareJid);
+//# try {
+//# if (c.bareJid!=null)
+//# clipboard.setClipBoard(c.bareJid);
+//# } catch (Exception e) {/*no messages*/}
+//# }
+//# break;
+//# }
+//#endif
+
+//#if GAMES
+//# case 777: // checkers
+//# switch (c.getCheckers()) {
+//# case -4: //END_GAME_FLAG:
+//# c.setCheckers(-6);
+//# roster.theStream.send(new IqCheckers(c.getJid()));
+//# break;
+//# case -6: //START_GAME_REQUEST_FLAG:
+//# c.setCheckers(-5);
+//# roster.theStream.send(new IqCheckers(c.getJid(), true));
+//# new Checkers(display, c);
+//# return;
+//# }
+//# break;
+//#
+//# case 778: // end checkers
+//# c.setCheckers(-4);
+//# roster.theStream.send(new IqCheckers(c.getJid(), false));
+//# break;
+//#endif
}
if (c instanceof MucContact || g instanceof ConferenceGroup) {
@@ -403,6 +516,18 @@
new ConferenceQuickPrivelegeModify(null, mc, ConferenceQuickPrivelegeModify.OWNER);
return;
}
+
+//#ifdef CLIPBOARD
+//# case 105: //Copy JID
+//# {
+//# try {
+//# if (mc.realJid!=null)
+//# clipboard.setClipBoard(mc.realJid);
+//# } catch (Exception e) {}
+//# break;
+//# }
+//#endif
+
}
}
}
Index: bombus-plus/export/trunk/src/Client/Groups.java
===================================================================
--- bombus-plus/export/trunk/src/Client/Groups.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/Groups.java (working copy)
@@ -27,9 +27,9 @@
package Client;
-import com.alsutton.jabber.JabberBlockListener;
+/*import com.alsutton.jabber.JabberBlockListener;
import com.alsutton.jabber.JabberDataBlock;
-import com.alsutton.jabber.datablocks.Iq;
+import com.alsutton.jabber.datablocks.Iq;*/ //
import images.RosterIcons;
import java.util.*;
import locale.SR;
@@ -40,7 +40,7 @@
*
* @author Evg_S
*/
-public class Groups implements JabberBlockListener{
+public class Groups /*implements JabberBlockListener*/{ //
Vector groups;
@@ -49,20 +49,20 @@
public final static int TYPE_COMMON=3;
public final static int TYPE_IGNORE=4;
public final static int TYPE_NOT_IN_LIST=5;
- public final static int TYPE_TRANSP=6;
- public final static int TYPE_MUC=7;
+ public final static int TYPE_TRANSP=/*6*/7; //
+ public final static int TYPE_MUC=/*7*/6; //
public final static int TYPE_SEARCH_RESULT=8;
public final static String COMMON_GROUP=SR.MS_GENERAL;
- private final static String GROUPSTATE_NS="http://bombus-im.org/groups";
+ //private final static String GROUPSTATE_NS="http://bombus-im.org/groups";
public Groups(){
groups=new Vector();
addGroup(SR.MS_TRANSPORTS, Groups.TYPE_TRANSP);
- addGroup(SR.MS_SELF_CONTACT, Groups.TYPE_SELF);
+ addGroup(/*SR.MS_SELF_CONTACT */ "self-contacts", Groups.TYPE_SELF);
addGroup(SR.MS_SEARCH_RESULTS, Groups.TYPE_SEARCH_RESULT);
- addGroup(SR.MS_NOT_IN_LIST, Groups.TYPE_NOT_IN_LIST);
+ addGroup(/*SR.MS_NOT_IN_LIST */ "Not-in-list", Groups.TYPE_NOT_IN_LIST);
addGroup(SR.MS_IGNORE_LIST, Groups.TYPE_IGNORE);
addGroup(Groups.COMMON_GROUP, Groups.TYPE_NO_GROUP);
}
@@ -150,7 +150,7 @@
groups.removeElement(g);
}
- public int blockArrived(JabberDataBlock data) {
+ /*public int blockArrived(JabberDataBlock data) { //group state collapsed
if (data instanceof Iq)
if (data.getTypeAttribute().equals("result")) {
JabberDataBlock query=data.findNamespace("query", "jabber:iq:private");
@@ -193,5 +193,5 @@
}
//System.out.println(iq.toString());
roster.theStream.send(iq);
- }
+ }*/
}
Index: bombus-plus/export/trunk/src/Client/AccountForm.java
===================================================================
--- bombus-plus/export/trunk/src/Client/AccountForm.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/AccountForm.java (working copy)
@@ -38,7 +38,7 @@
import javax.microedition.lcdui.ItemStateListener;
import javax.microedition.lcdui.TextField;
import locale.SR;
-import ui.ConstMIDP;
+//import ui.ConstMIDP; //
import ui.controls.NumberField;
import ui.controls.TextFieldCombo;
@@ -85,8 +85,8 @@
SR.MS_NEW_ACCOUNT /*"New Account"*/:
(account.toString());
f = new Form(title);
- userbox = new TextField(SR.MS_USERNAME, account.getUserName(), 64, ConstMIDP.TEXTFIELD_URL);
- TextFieldCombo.setLowerCaseLatin(userbox);
+ userbox = new TextField(SR.MS_USERNAME, account.getUserName(), 64, TextField.URL); //
+ //TextFieldCombo.setLowerCaseLatin(userbox); //
f.append(userbox);
passbox = new TextField(SR.MS_PASSWORD, account.getPassword(), 64, TextField.PASSWORD); f.append(passbox);
@@ -97,7 +97,11 @@
register = new ChoiceGroup(null, Choice.MULTIPLE);
register.append(SR.MS_SSL,null);
register.append(SR.MS_PLAIN_PWD,null);
- register.append(SR.MS_NO_COMPRESSION,null);
+//#if NONSASL_ENABLE
+//# register.append(SR.MS_SASL, null);
+//#else
+ register.append(SR.MS_NO_COMPRESSION,null);
+//#endif
register.append(SR.MS_CONFERENCES_ONLY,null);
//#if HTTPCONNECT
//# register.append("Proxy connect",null);
@@ -105,7 +109,15 @@
//# register.append("HTTP Polling",null);
//#endif
register.append(SR.MS_REGISTER_ACCOUNT,null);
- boolean b[] = {account.getUseSSL(), account.getPlainAuth(), !account.useCompression(), account.isMucOnly(),
+ boolean b[] = {
+ account.getUseSSL(),
+ account.getPlainAuth(),
+//#if NONSASL_ENABLE
+//# account.isSASL(),
+//#else
+ !account.useCompression(),
+//#endif
+ account.isMucOnly(),
//#if HTTPPOLL || HTTPCONNECT
//# account.isEnableProxy(),
//#endif
@@ -124,7 +136,7 @@
//# f.append(proxyHost);
//#endif
- keepAliveType=new ChoiceGroup(SR.MS_KEEPALIVE, ConstMIDP.CHOICE_POPUP);
+ keepAliveType=new ChoiceGroup(SR.MS_KEEPALIVE, ChoiceGroup.POPUP); //
keepAliveType.append("by socket", null);
keepAliveType.append("1 byte", null);
keepAliveType.append("", null);
@@ -149,7 +161,7 @@
private void passStars(boolean force) {
if (passbox.size()==0 || force)
- passbox.setConstraints(TextField.ANY | ConstMIDP.TEXTFIELD_SENSITIVE);
+ passbox.setConstraints(TextField.ANY | TextField.SENSITIVE); //
fixPassBugWEME();
}
@@ -197,7 +209,11 @@
account.setNick(nickbox.getString());
account.setUseSSL(b[0]);
account.setPlainAuth(b[1]);
+//#if NONSASL_ENABLE
+//# account.setSasl(b[2]);
+//#else
account.setUseCompression(!b[2]);
+//#endif
account.setMucOnly(b[3]);
//#if HTTPPOLL || HTTPCONNECT
Index: bombus-plus/export/trunk/src/Client/Reconnect.java
===================================================================
--- bombus-plus/export/trunk/src/Client/Reconnect.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/Reconnect.java (working copy)
@@ -44,7 +44,7 @@
private Gauge timer;
boolean isRunning;
- private final static int WAITTIME=5;
+ private final static int WAITTIME=10; //
/** Creates a new instance of Reconnect */
private Command cmdCancel=new Command(SR.MS_CANCEL, Command.BACK, 2);
public Reconnect(String title, String body, Display display) {
Index: bombus-plus/export/trunk/src/Client/StatusSelect.java
===================================================================
--- bombus-plus/export/trunk/src/Client/StatusSelect.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/StatusSelect.java (working copy)
@@ -42,10 +42,16 @@
private Command cmdOk=new Command(SR.MS_SELECT,Command.OK,1);
private Command cmdEdit=new Command(SR.MS_EDIT,Command.SCREEN,2);
+ private Command cmdSetDefault=new Command(SR.MS_SETDEFAULT,Command.OK,5); //
+ private Command cmdReconnect=new Command("Reconnect now!",Command.SCREEN,6); //
private Command cmdCancel=new Command(SR.MS_CANCEL,Command.BACK,99);
/** Creates a new instance of SelectStatus */
private Vector statusList;
private Contact to;
+ //
+ private Config cf=Config.getInstance();
+ private int defstatus;
+ //
public StatusSelect(Display d, Contact to) {
super();
@@ -57,11 +63,16 @@
addCommand(cmdOk);
addCommand(cmdEdit);
+ addCommand(cmdSetDefault); //
+ addCommand(cmdReconnect); //
//addCommand(cmdPriority);
//addCommand(cmdAll);
addCommand(cmdCancel);
setCommandListener(this);
-
+ //
+ defstatus=Config.getInstance().def_status;
+ moveCursorTo(defstatus);
+ //
/*
int status=StaticData.getInstance().roster.myStatus;
int i;
@@ -83,6 +94,16 @@
if (c==cmdEdit) {
new StatusForm( display, getSel() );
};
+ //
+ if (c==cmdSetDefault) {
+ cf.def_status=cursor;
+ cf.saveToStorage();
+ redraw();
+ }
+ if (c==cmdReconnect) {
+ StaticData.getInstance().roster.connectionTerminated(new Exception("reconnecting!!!"));
+ }
+ //
if (c==cmdCancel) destroyView();
}
@@ -126,7 +147,13 @@
f=new Form(status.getScreenName());
- tfMessage=new TextFieldCombo(SR.MS_MESSAGE, status.getMessage(), 100, 0, "status", display);
+ tfMessage=new TextFieldCombo(SR.MS_MESSAGE, status.getMessage(),
+//#if !ReleaseZVOFFK
+ 200,
+//#else
+//# 250,
+//#endif
+ 0, "status", display);
f.append(tfMessage);
tfPriority=new NumberField(SR.MS_PRIORITY, status.getPriority(), -128, 128);
@@ -172,4 +199,4 @@
public void setParentView(Displayable parentView){
this.parentView=parentView;
}
-}
+}
\ No newline at end of file
Index: bombus-plus/export/trunk/src/Client/EntityCaps.java
===================================================================
--- bombus-plus/export/trunk/src/Client/EntityCaps.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/EntityCaps.java (working copy)
@@ -1,7 +1,7 @@
/*
* EntityCaps.java
*
- * Created on 17 Июнь 2007 г., 2:58
+ * Created on 17 2007 ., 2:58
*
* Copyright (c) 2005-2007, Eugene Stahov (evgs), http://bombus-im.org
*
@@ -116,7 +116,7 @@
return c;
}
- private final static String BOMBUS_NAMESPACE="http://bombus-im.org/java";
+ private final static String BOMBUS_NAMESPACE="http://voffk.org.ru/bombus"; //
private final static String BOMBUS_ID_CATEGORY="client";
private final static String BOMBUS_ID_TYPE="mobile";
@@ -134,11 +134,11 @@
//#endif
//#ifdef PEP
- if (Config.getInstance().enablePep) {
+ if (Config.getInstance().enableMood) { //
features.addElement("http://jabber.org/protocol/mood");
features.addElement("http://jabber.org/protocol/mood+notify");
}
-//#endif
+//#endif
features.addElement("http://jabber.org/protocol/muc");
@@ -147,12 +147,12 @@
features.addElement("http://jabber.org/protocol/si/profile/file-transfer");
//#endif
-//#ifdef PEP
- if (Config.getInstance().enablePep) {
+//#ifdef PEP_TUNE
+ if (Config.getInstance().enableTune) { //
features.addElement("http://jabber.org/protocol/tune");
features.addElement("http://jabber.org/protocol/tune+notify");
}
-//#endif
+//#endif
features.addElement("jabber:iq:time"); //DEPRECATED
features.addElement("jabber:iq:version");
Index: bombus-plus/export/trunk/src/Client/RosterToolsMenu.java
===================================================================
--- bombus-plus/export/trunk/src/Client/RosterToolsMenu.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/RosterToolsMenu.java (working copy)
@@ -38,6 +38,9 @@
import ui.MenuItem;
import vcard.VCard;
import vcard.vCardForm;
+//#ifdef XML_CONSOLE
+//# import xml.console.XMLList;
+//#endif
/**
*
@@ -49,13 +52,13 @@
/** Creates a new instance of RosterToolsMenu */
public RosterToolsMenu(Display display) {
super(SR.MS_TOOLS);
+ addItem(SR.MS_DISCO, 0);
+ addItem(SR.MS_PRIVACY_LISTS, 1);
//#ifdef PEP
- if (Config.getInstance().enablePep)
+ if (Config.getInstance().enableMood)
addItem(SR.MS_USERMOOD, 6);
//#endif
- addItem(SR.MS_DISCO, 0);
- addItem(SR.MS_PRIVACY_LISTS, 1);
addItem(SR.MS_MY_VCARD, 2);
addItem(SR.MS_OPTIONS, 3);
/*if (m.getItemCount()>0)*/
@@ -65,6 +68,9 @@
addItem(SR.MS_FILE_TRANSFERS, 5);
//#endif
+//#ifdef XML_CONSOLE
+//# addItem("XML console", 10);
+//#endif
/*addItem("Break connection", 10);*/
@@ -108,10 +114,16 @@
//#ifdef PEP
case 6:
+ if (connected) //<+voffk>
new MoodList(display);
return;
//#endif
- //case 10:
+//#ifdef XML_CONSOLE
+//# case 10:
+//# new XMLList(display);
+//# return;
+//#endif
+ //case 10:
// StaticData.getInstance().roster.connectionTerminated(new Exception("Simulated break"));
// return;
Index: bombus-plus/export/trunk/src/Client/Msg.java
===================================================================
--- bombus-plus/export/trunk/src/Client/Msg.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/Msg.java (working copy)
@@ -46,6 +46,10 @@
public final static int MESSAGE_TYPE_OUT=1;
public final static int MESSAGE_TYPE_PRESENCE=2;
public final static int MESSAGE_TYPE_HISTORY=3;
+//#if PEP
+ public final static int MESSAGE_TYPE_MOOD=7; //<+voffk>
+//#endif
+
// with signaling
public final static int MESSAGE_TYPE_IN=10;
public final static int MESSAGE_TYPE_HEADLINE=11;
@@ -94,6 +98,9 @@
case MESSAGE_TYPE_AUTH: return Colors.MESSAGE_AUTH;
case MESSAGE_TYPE_HISTORY: return Colors.MESSAGE_HISTORY;
case MESSAGE_TYPE_SUBJ:return Colors.MSG_SUBJ;
+//#if PEP
+ case MESSAGE_TYPE_MOOD: return Colors.MESSAGE_PRESENCE_S; //<+voffk>
+//#endif
//case MESSAGE_TYPE_ERROR: return Colors.MESSAGE_OUT;
}
return Colors.LIST_INK;
@@ -107,8 +114,14 @@
return time.toString();
}
- public String quoteString(){
- StringBuffer out=new StringBuffer(toString());
+ public String quoteString(){ //
+ StringBuffer out=new StringBuffer();
+ if (subject!=null) if (subject.length()!=0) {
+ out.append("[");
+ out.append(subject);
+ out.append("]\n");
+ }
+ out.append(toString());
int i=0;
while (i
+ int lastSpace=src.lastIndexOf((byte) ' ');
+ String date=src.substring(lastSpace+1);
+ try {
+ this.dateGmt=Long.parseLong(date);
+ } catch (java.lang.NumberFormatException e) {
+ this.dateGmt=Time.dateIso8601(src);
+ }
+ }
}
Index: bombus-plus/export/trunk/src/Client/AlertProfile.java
===================================================================
--- bombus-plus/export/trunk/src/Client/AlertProfile.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/AlertProfile.java (working copy)
@@ -89,13 +89,13 @@
public String toString(){
StringBuffer s=new StringBuffer();
switch (index) {
- case AUTO: s.append(SR.MS_ALERT_PROFILE_AUTO); break;
- case ALL: s.append(SR.MS_ALERT_PROFILE_ALLSIGNALS); break;
- case VIBRA: s.append(SR.MS_ALERT_PROFILE_VIBRA); break;
- case SOUND: s.append(SR.MS_SOUND); break;
- case NONE: s.append(SR.MS_ALERT_PROFILE_NOSIGNALS); break;
+ case AUTO: s.append( "Auto" ); break;
+ case ALL: s.append( "All signals" ); break;
+ case VIBRA: s.append( "Vibration" ); break;
+ case SOUND: s.append( "Sound" ); break;
+ case NONE: s.append( "No signals" ); break;
}
- if (index==defp) s.append(SR.MS_IS_DEFAULT);
+ if (index==defp) s.append( " (default)");
return s.toString();
}
}
Index: bombus-plus/export/trunk/src/Client/ConfigForm.java
===================================================================
--- bombus-plus/export/trunk/src/Client/ConfigForm.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/ConfigForm.java (working copy)
@@ -74,19 +74,27 @@
Form f;
ChoiceGroup roster;
- ChoiceGroup subscr;
-
- ChoiceGroup nil;
+ //ChoiceGroup nil;
ChoiceGroup message;
NumberField MessageLimit;
ChoiceGroup startup;
ChoiceGroup application;
+ //
+//#if !(ReleaseZLITE)
ChoiceGroup lang;
+//#endif
+//#if ARCHIVE_ADVANCED
+ ChoiceGroup archive;
+ boolean arch[];
+//#endif
ChoiceGroup sndFile;
- //Gauge sndVol;
+ Gauge sndVol;
+ NumberField maxreconnect;
+ //
+
ChoiceGroup font1;
ChoiceGroup font2;
@@ -116,7 +124,9 @@
boolean ap[];
boolean su[];
Vector files[];
+//#if !(ReleaseZLITE)
Vector langs[];
+//#endif
/** Creates a new instance of ConfigForm */
public ConfigForm(Display display) {
@@ -128,37 +138,41 @@
f=new Form(SR.MS_OPTIONS);
roster=new ChoiceGroup(SR.MS_ROSTER_ELEMENTS, Choice.MULTIPLE);
roster.append(SR.MS_OFFLINE_CONTACTS, null);
- roster.append(SR.MS_SELF_CONTACT, null);
+//#if !ReleaseZVOFFK
+ roster.append("self-contacts", null);
roster.append(SR.MS_TRANSPORTS, null);
+//#endif
roster.append(SR.MS_IGNORE_LIST, null);
- //roster.append(SR.MS_NOT_IN_LIST, null);
+//#if !ReleaseZVOFFK
+ roster.append("Not-in-list presences", null);
+//#endif
roster.append(SR.MS_AUTOFOCUS,null);
+ roster.append(SR.MS_AUTH_NEW,null);
+ roster.append(SR.MS_LAST_APPEARED_CONTACTS, null);
boolean ra[]={
cf.showOfflineContacts,
- cf.selfContact,
- cf.showTransports,
+//#if !ReleaseZVOFFK
+ cf.selfContact,
+ cf.showTransports,
+//#endif
cf.ignore,
- //cf.notInList,
- cf.autoFocus
+//#if !ReleaseZVOFFK
+ cf.notInListPresences,
+//#endif
+ cf.autoFocus,
+ cf.autoSubscribe,
+ cf.lastAppearedContacts //
};
this.ra=ra;
//ra[5]=false;
roster.setSelectedFlags(ra);
-
- subscr=new ChoiceGroup(SR.MS_AUTH_NEW, Choice.POPUP);
- subscr.append(SR.MS_SUBSCR_AUTO, null);
- subscr.append(SR.MS_SUBSCR_ASK, null);
- subscr.append(SR.MS_SUBSCR_DROP, null);
- subscr.append(SR.MS_SUBSCR_REJECT, null);
- subscr.setSelectedIndex(cf.autoSubscribe, true);
-
-
- nil=new ChoiceGroup(SR.MS_NOT_IN_LIST, ConstMIDP.CHOICE_POPUP);
+
+ /*nil=new ChoiceGroup(SR.MS_NOT_IN_LIST, ConstMIDP.CHOICE_POPUP);
nil.append(SR.MS_NIL_DROP_MP, null);
nil.append(SR.MS_NIL_DROP_P, null);
nil.append(SR.MS_NIL_ALLOW_ALL, null);
- nil.setSelectedIndex((cf.notInListDropLevel>NotInListFilter.ALLOW_ALL)? NotInListFilter.ALLOW_ALL: cf.notInListDropLevel, true);
+ nil.setSelectedIndex((cf.notInListDropLevel>NotInListFilter.ALLOW_ALL)? NotInListFilter.ALLOW_ALL: cf.notInListDropLevel, true); */ //
message=new ChoiceGroup(SR.MS_MESSAGES, Choice.MULTIPLE);
message.append(SR.MS_SMILES, null);
@@ -168,10 +182,22 @@
message.append(SR.MS_STORE_PRESENCE,null);
message.append(SR.MS_COMPOSING_EVENTS, null);
message.append(SR.MS_DELIVERY, null);
-//#if (!MIDP1)
message.append(SR.MS_CAPS_STATE, null);
+ //
+ //message.append(SR.MS_PEP, null);
+ message.append(SR.MS_EMULATE_TABS, null);
+ message.append(SR.MS_CONFIRM_DELETE_MESSAGES, null);
+ message.append(SR.MS_AUTOSCROLL, null);
+//#if CLIPBOARD
+//# message.append(SR.MS_CLIPBOARD, null);
//#endif
- message.append(SR.MS_PEP, null);
+//#if PEP
+ message.append(SR.MS_MOOD, null);
+ //#if PEP_TUNE
+ message.append(SR.MS_TUNE, null);
+ //#endif
+//#endif
+ //
boolean mv[]={
cf.smiles,
@@ -181,10 +207,21 @@
cf.storeConfPresence,
cf.eventComposing,
cf.eventDelivery,
-//#if (!MIDP1)
cf.capsState,
+ //
+ cf.useTabs,
+ cf.confirmDelete,
+ cf.autoScroll,
+//#if CLIPBOARD
+//# cf.useClipBoard,
//#endif
- cf.enablePep
+//#if PEP
+ cf.enableMood,
+ //#if PEP_TUNE
+ cf.enableTune
+ //#endif
+//#endif
+ //
};
this.mv=mv;
@@ -195,32 +232,45 @@
startup=new ChoiceGroup(SR.MS_STARTUP_ACTIONS, Choice.MULTIPLE);
startup.append(SR.MS_AUTOLOGIN, null);
startup.append(SR.MS_AUTO_CONFERENCES,null);
- su=new boolean[2];
+ //
+ startup.append(SR.MS_ACCOUNT_SELECT, null);
+ su=new boolean[3];
su[0]=cf.autoLogin;
su[1]=cf.autoJoinConferences;
+ su[2]=cf.accountSelect;
+ //
startup.setSelectedFlags(su);
-
- ap=new boolean[5];
+
+ ap=new boolean[7];
int apctr=0;
application=new ChoiceGroup(SR.MS_APPLICATION, Choice.MULTIPLE);
-//#if !(MIDP1)
+ application.append(SR.MS_FULLSCREEN,null);
ap[apctr++]=cf.fullscreen;
- application.append(SR.MS_FULLSCREEN,null);
-//#endif
application.append(SR.MS_HEAP_MONITOR,null);
+ ap[apctr++]=cf.memMonitor;
application.append(SR.MS_SHOW_HARDWARE,null);
- if (!cf.ghostMotor)
+ ap[apctr++]=cf.enableVersionOs;
+ if (!cf.ghostMotor) {
+ ap[apctr++]=cf.blFlash;
application.append(SR.MS_FLASHBACKLIGHT,null);
- if (cf.allowMinimize)
+ }
+//#if LIGHT_CONTROL
+//# ap[apctr++]=cf.lightState;
+//# application.append("turn on light (SIE, SE & Nokia)", null);
+//#endif
+ if (cf.allowMinimize) {
+ ap[apctr++]=cf.popupFromMinimized;
application.append(SR.MS_ENABLE_POPUP,null);
- ap[apctr++]=cf.memMonitor;
- ap[apctr++]=cf.enableVersionOs;
- ap[apctr++]=cf.blFlash;
- ap[apctr++]=cf.popupFromMinimized;
-
+ }
+//#if TRAFFIC
+//# //
+//# ap[apctr++]=cf.counterTraffic;
+//# application.append(SR.MS_TRAFFIC_COUNTER, null);
+//#endif
+
application.setSelectedFlags(ap);
- autoAwayType=new ChoiceGroup(SR.MS_AWAY_TYPE, ConstMIDP.CHOICE_POPUP);
+ autoAwayType=new ChoiceGroup(SR.MS_AWAY_TYPE, ChoiceGroup.POPUP); //
autoAwayType.append(SR.MS_AWAY_OFF, null);
autoAwayType.append(SR.MS_AWAY_LOCK, null);
autoAwayType.append(SR.MS_AWAY_IDLE, null);
@@ -232,9 +282,22 @@
fieldGmt=new NumberField(SR.MS_GMT_OFFSET, cf.gmtOffset, -12, 12);
fieldLoc=new NumberField(SR.MS_CLOCK_OFFSET, cf.locOffset, -12, 12 );
- sndFile=new ChoiceGroup(SR.MS_SOUND, ConstMIDP.CHOICE_POPUP);
- files=new StringLoader().stringLoader("/sounds/res.txt",3);
+ sndFile=new ChoiceGroup(SR.MS_SOUND, ChoiceGroup.POPUP); //
+
+ //
+ sndVol=new Gauge(SR.MS_SOUND_VOLUME, true, 10, cf.soundVol/10);
+//#if ARCHIVE_ADVANCED
+ archive=new ChoiceGroup(SR.MS_ARCHIVE, Choice.MULTIPLE);
+ archive.append("export to cp1251", null);
+ arch=new boolean[1];
+ arch[0]=cf.cp1251;
+ archive.setSelectedFlags(arch);
+//#endif
+ maxreconnect=new NumberField(SR.MS_MAX_RECONNECT, cf.maxReconnect, 0, 30);
+ //
+ files=new StringLoader().stringLoader("/sounds/res.txt",3);
+
for (Enumeration f=files[2].elements(); f.hasMoreElements(); ) {
sndFile.append( (String)f.nextElement(), null );
}
@@ -244,7 +307,7 @@
} catch (Exception e) { cf.soundsMsgIndex=0; };
//#if COLOR_THEMES
- themeFile=new ChoiceGroup(SR.MS_COLOR_THEME, ConstMIDP.CHOICE_POPUP);
+ themeFile=new ChoiceGroup(SR.MS_COLOR_THEME, ChoiceGroup.POPUP); //
themeFiles=new StringLoader().stringLoader("/themes/res.txt",2);
for (Enumeration f=themeFiles[1].elements(); f.hasMoreElements(); ) {
themeFile.append( (String)f.nextElement(), null );
@@ -255,33 +318,41 @@
//#endif
String fnts[]={SR.MS_FONTSIZE_NORMAL, SR.MS_FONTSIZE_SMALL, SR.MS_FONTSIZE_LARGE};
- font1=new ChoiceGroup(SR.MS_ROSTER_FONT, ConstMIDP.CHOICE_POPUP, fnts, null);
- font2=new ChoiceGroup(SR.MS_MESSAGE_FONT, ConstMIDP.CHOICE_POPUP, fnts, null);
+ font1=new ChoiceGroup(SR.MS_ROSTER_FONT, ChoiceGroup.POPUP, fnts, null); //
+ font2=new ChoiceGroup(SR.MS_MESSAGE_FONT, ChoiceGroup.POPUP, fnts, null); //
font1.setSelectedIndex(cf.font1/8, true);
font2.setSelectedIndex(cf.font2/8, true);
+//#if COLOR_THEMES
+ f.append(themeFile);
+//#endif
+ f.append(sndFile); //
+ f.append(sndVol); //
+
f.append(roster);
- f.append(subscr);
- f.append(nil);
+ //f.append(nil);
f.append(font1);
+ f.append(font2); //
f.append(message);
f.append(MessageLimit);
- f.append(font2);
+ //f.append(font2);
String textWraps[]={SR.MS_TEXTWRAP_CHARACTER, SR.MS_TEXTWRAP_WORD};
- textWrap=new ChoiceGroup(SR.MS_TEXTWRAP, ConstMIDP.CHOICE_POPUP, textWraps,null);
+ textWrap=new ChoiceGroup(SR.MS_TEXTWRAP, ChoiceGroup.POPUP, textWraps,null); //
textWrap.setSelectedIndex(cf.textWrap, true);
f.append(textWrap);
- f.append(sndFile);
-
-//#if COLOR_THEMES
- f.append(themeFile);
-//#endif
+ //
+ //f.append(sndFile);
+
+///#if COLOR_THEMES
+// f.append(themeFile);
+///#endif
- lang=new ChoiceGroup("Language", ConstMIDP.CHOICE_POPUP);
- langs=new StringLoader().stringLoader("/lang/res.txt",3);
+//#if !(ReleaseZLITE)
+ lang=new ChoiceGroup("Language", ChoiceGroup.POPUP); //
+ langs=new StringLoader().stringLoader("/lang/res.txt",3);
for (int i=0; i
+//#if ARCHIVE_ADVANCED
+ f.append(archive); //
//#endif
-
f.append(startup);
f.append(application);
-
+
+ f.append(maxreconnect); //
+
f.append(autoAwayType);
f.append(fieldAwatDelay);
//f.append(keepAlive);
- f.append(SR.MS_TIME_SETTINGS);
- f.append("\n");
+ /*f.append(SR.MS_TIME_SETTINGS);
+ f.append("\n");*/
f.append(fieldGmt);
f.append(fieldLoc);
+//#if !(ReleaseZLITE)
f.append(lang);
+//#endif
f.addCommand(cmdOk);
f.addCommand(cmdCancel);
@@ -334,17 +410,24 @@
message.getSelectedFlags(mv);
application.getSelectedFlags(ap);
startup.getSelectedFlags(su);
-
- cf.notInListDropLevel=nil.getSelectedIndex();
- cf.showOfflineContacts=ra[0];
- cf.selfContact=ra[1];
- cf.showTransports=ra[2];
- cf.ignore=ra[3];
- //cf.notInList=ra[4];
- cf.autoFocus=ra[4];
- cf.autoSubscribe=subscr.getSelectedIndex();
-
+ //cf.notInListDropLevel=nil.getSelectedIndex();
+ int raIdx=0;
+ cf.showOfflineContacts=ra[raIdx++];
+ /*cf.selfContact=ra[1];
+ cf.showTransports=ra[2];*/ //
+//#if !ReleaseZVOFFK
+ cf.selfContact=ra[raIdx++];
+ cf.showTransports=ra[raIdx++];
+//#endif
+ cf.ignore=ra[raIdx++];
+//#if !ReleaseZVOFFK
+ cf.notInListPresences=ra[raIdx++];
+//#endif
+ cf.autoFocus=ra[raIdx++];
+ cf.autoSubscribe=ra[raIdx++];
+ cf.lastAppearedContacts=ra[raIdx++]; //
+
cf.smiles=mv[0];
int haIdx=1;
//#if (HISTORY)
@@ -354,23 +437,41 @@
cf.storeConfPresence=mv[haIdx++];
cf.eventComposing=mv[haIdx++];
cf.eventDelivery=mv[haIdx++];
-//#if (!MIDP1)
cf.capsState=mv[haIdx++];
+ //
+ cf.useTabs=mv[haIdx++];
+ cf.confirmDelete=mv[haIdx++];
+ cf.autoScroll=mv[haIdx++];
+//#if CLIPBOARD
+//# cf.useClipBoard=mv[haIdx++];
//#endif
- cf.enablePep=mv[haIdx++];
+//#if PEP
+ cf.enableMood=mv[haIdx++];
+ //#if PEP_TUNE
+ cf.enableTune=mv[haIdx++];
+ //#endif
+//#endif
cf.autoLogin=su[0];
cf.autoJoinConferences=su[1];
+ cf.accountSelect=su[2];
+ //
int apctr=0;
-//#if !(MIDP1)
VirtualList.fullscreen=cf.fullscreen=ap[apctr++];
StaticData.getInstance().roster.setFullScreenMode(cf.fullscreen);
-//#endif
VirtualList.memMonitor=cf.memMonitor=ap[apctr++];
cf.enableVersionOs=ap[apctr++];
- cf.blFlash=ap[apctr++];
- cf.popupFromMinimized=ap[apctr++];
+ if (!cf.ghostMotor)
+ cf.blFlash=ap[apctr++];
+//#if LIGHT_CONTROL
+//# cf.lightState=ap[apctr++];
+//#endif
+ if (cf.allowMinimize)
+ cf.popupFromMinimized=ap[apctr++];
+//#if TRAFFIC
+//# cf.counterTraffic=ap[apctr++]; //
+//#endif
cf.gmtOffset=fieldGmt.getValue();
cf.locOffset=fieldLoc.getValue();
@@ -389,44 +490,58 @@
cf.textWrap=textWrap.getSelectedIndex();
- //cf.soundVol=sndVol.getValue()*10;
- cf.lang=(String) langs[0].elementAt( lang.getSelectedIndex() );
-
+ //
+ cf.soundVol=sndVol.getValue()*10;
+//#if ARCHIVE_ADVANCED
+ archive.getSelectedFlags(arch);
+ cf.cp1251=arch[0];
+//#endif
+ cf.maxReconnect=maxreconnect.getValue();
+//#if !(ReleaseZLITE)
+ cf.lang=(String) langs[0].elementAt( lang.getSelectedIndex() );
+//#else
+//# cf.lang="ru";
+//#endif
+ //
cf.autoAwayDelay=fieldAwatDelay.getValue();
cf.autoAwayType=autoAwayType.getSelectedIndex();
cf.loadSoundName();
cf.messageCollapsedLength=MessageLimit.getValue();
-
+//#if LIGHT_CONTROL
+//# StaticData.getInstance().roster.setLight(cf.lightState);
+//#endif
cf.updateTime();
cf.saveToStorage();
- EntityCaps.initCaps();
- StaticData.getInstance().roster.sendPresence(Presence.PRESENCE_SAME);
+ //
+ if (StaticData.getInstance().roster.isLoggedIn()) {
+ String oldVerHash=EntityCaps.calcVerHash();
+
+ EntityCaps.initCaps();
+
+ if (!oldVerHash.equals(EntityCaps.calcVerHash()))
+ StaticData.getInstance().roster.sendPresence(Presence.PRESENCE_SAME, null);
+ }
+ //
+
StaticData.getInstance().roster.reEnumRoster();
destroyView();
}
-//#if MIDP1
-//# if (c==cmdPlaySound) testSound();
-//#endif
if (c==cmdCancel) destroyView();
}
-//#if !(MIDP1)
public void commandAction(Command command, Item item) {
if (command==cmdPlaySound) {
testSound();
}
}
-//#endif
public void destroyView(){
if (display!=null) display.setCurrent(parentView);
-//#if !(MIDP1)
((Canvas)parentView).setFullScreenMode(cf.fullscreen);
-//#endif
}
/*public void itemStateChanged(Item item) {
@@ -436,7 +551,10 @@
int sound=sndFile.getSelectedIndex();
String soundFile=(String)files[1].elementAt(sound);
String soundType=(String)files[0].elementAt(sound);
- new EventNotify(display, soundType, soundFile, 0, false).startNotify();
+ //
+ int soundVol=sndVol.getValue()*10;
+ new EventNotify(display, soundType, soundFile, soundVol, 0, false).startNotify();
+ //
}
}
Index: bombus-plus/export/trunk/src/Client/MessageEdit.java
===================================================================
--- bombus-plus/export/trunk/src/Client/MessageEdit.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/MessageEdit.java (working copy)
@@ -32,6 +32,9 @@
import locale.SR;
import ui.Time;
import ui.VirtualList;
+//#ifdef CLIPBOARD
+//# import util.ClipBoard; //
+//#endif
/**
*
@@ -59,6 +62,12 @@
private Command cmdABC=new Command("Abc", Command.SCREEN, 15);
private Command cmdAbc=new Command("abc", Command.SCREEN, 15);
+//#ifdef CLIPBOARD
+//# private Command cmdPasteText=new Command(SR.MS_PASTE, Command.SCREEN, 10);
+//# private ClipBoard clipboard;
+//#endif
+ private Config cf=Config.getInstance(); //
+
private boolean composing=true;
//private Command cmdSubject=new Command("Subject",Command.SCREEN,10);
@@ -91,7 +100,16 @@
t.addCommand(cmdSmile);
if (to.origin>=Contact.ORIGIN_GROUPCHAT)
t.addCommand(cmdInsNick);
- t.addCommand(cmdPaste);
+
+//#ifdef CLIPBOARD
+//# if (cf.useClipBoard) {
+//# clipboard=ClipBoard.getInstance();
+//# if (!clipboard.isEmpty())
+//# t.addCommand(cmdPasteText);
+//# }
+//#endif
+
+ t.addCommand(cmdPaste);
t.addCommand(cmdSuspend);
t.addCommand(cmdCancel);
t.setCommandListener(this);
@@ -102,7 +120,7 @@
//t.setInitialInputMode("MIDP_LOWERCASE_LATIN");
new Thread(this).start() ; // composing
- setInitialCaps(Config.getInstance().capsState);
+ setInitialCaps(cf.capsState); //
display.setCurrent(t);
}
@@ -156,6 +174,12 @@
if (c==cmdInsNick) { new AppendNick(display, to, this, caretPos); return; }
if (c==cmdAbc) {setInitialCaps(false); return; }
if (c==cmdABC) {setInitialCaps(true); return; }
+
+//#ifdef CLIPBOARD
+//# if (c==cmdPasteText) { insertText(clipboard.getClipBoard(), caretPos); return; }
+//#endif
+
+
if (c==cmdPaste) { new ArchiveList(display, this, caretPos); return; }
if (c==cmdCancel) {
@@ -202,7 +226,7 @@
} else if (to.acceptComposing) comp=(composing)? "composing":"paused";
- if (!Config.getInstance().eventComposing) comp=null;
+ if (!cf.eventComposing) comp=null; //
try {
if (body!=null || subj!=null || comp!=null)
@@ -218,12 +242,10 @@
}
private void setInitialCaps(boolean state) {
-//#if (!MIDP1)
t.setConstraints(state? TextField.INITIAL_CAPS_SENTENCE: TextField.ANY);
t.removeCommand(state? cmdABC: cmdAbc);
t.addCommand(state? cmdAbc: cmdABC);
- Config.getInstance().capsState=state;
-//#endif
+ cf.capsState=state; //
}
}
Index: bombus-plus/export/trunk/src/Client/SubscriptionEdit.java
===================================================================
--- bombus-plus/export/trunk/src/Client/SubscriptionEdit.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/SubscriptionEdit.java (working copy)
@@ -40,6 +40,7 @@
Command cmdAskSubscr=new Command(SR.MS_ASK_SUBSCRIPTION, Command.SCREEN, 1);
Command cmdGrantSubscr=new Command(SR.MS_GRANT_SUBSCRIPTION, Command.SCREEN, 2);
Command cmdSubscrDel=new Command(SR.MS_SUBSCR_REMOVE, Command.SCREEN, 3);
+ Command cmdDenyPresences=new Command(SR.MS_UNSUBSCRIBE_FROM_PRESENCES, Command.SCREEN, 4); //
//Command cmdUnsubscr=new Command(SR.MS_UNSUBSCRIBE, Command.SCREEN);
Command cmdBack=new Command(SR.MS_CANCEL, Command.BACK, 99);
@@ -64,6 +65,7 @@
addCommand(cmdGrantSubscr);
addCommand(cmdAskSubscr);
addCommand(cmdSubscrDel);
+ addCommand(cmdDenyPresences); //
addCommand(cmdBack);
setCommandListener(this);
@@ -76,6 +78,7 @@
if (c==cmdAskSubscr) { presence="subscribe"; }
if (c==cmdGrantSubscr) { presence="subscribed"; }
if (c==cmdSubscrDel) { presence="unsubscribed"; }
+ if (c==cmdDenyPresences) { presence="unsubscribe"; } //
if (presence!=null) r.sendPresence(to,presence, null);
Index: bombus-plus/export/trunk/src/Client/Contact.java
===================================================================
--- bombus-plus/export/trunk/src/Client/Contact.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/Contact.java (working copy)
@@ -36,6 +36,7 @@
import ui.IconTextElement;
import ui.ImageList;
import com.alsutton.jabber.datablocks.Presence;
+import Client.Config; //<+voffk>
/**
* Contact
@@ -57,11 +58,21 @@
public final static int DELIVERY_XEP184=2;
public final static int DELIVERY_XEP22=3;*/
-
+ //
+ public short incomingState=0;
+ public final static short INC_NONE=0;
+ public final static short INC_APPEARING=1;
+ public final static short INC_VIEWING=2;
+
+ public boolean moveToLatest=false;
+ private Config cf;
+ //
+
/** Creates a new instance of Contact */
protected Contact (){
//lastReaded=0;
super(RosterIcons.getInstance());
+ cf=Config.getInstance(); //<+voffk>
msgs=new Vector();
key1="";
}
@@ -77,8 +88,8 @@
public boolean acceptComposing;
public Integer incomingComposing;
public int deliveryType;
- private boolean isActive;
-
+ //private boolean isActive;
+
public String msgSuspended;
//public int key1;
@@ -96,11 +107,16 @@
private int newMsgCnt=-1;
public int unreadType;
public int lastUnread;
+ ///public int breakPoint;///save cursor pos - voffk
public VCard vcard;
+//#if PEP
public int pepMood=-1;
+ //#if PEP_TUNE
public boolean pepTune;
+ //#endif
+//#endif
//public long conferenceJoinTime;
public int firstUnread(){
@@ -137,8 +153,12 @@
clone.status=status;
clone.transport=RosterIcons.getInstance().getTransportIndex(newjid.getTransport()); //<<<<
- clone.pepMood=pepMood;
+//#if PEP
+ clone.pepMood=pepMood;
+ //#if PEP_TUNE
clone.pepTune=pepTune;
+ //#endif
+//#endif
clone.bareJid=bareJid;
return clone;
@@ -151,34 +171,39 @@
default: return RosterIcons.ICON_MESSAGE_INDEX;
}
if (incomingComposing!=null) return RosterIcons.ICON_COMPOSING_INDEX;
+
+ if (incomingState>0) return incomingState; //
+
int st=(status==Presence.PRESENCE_OFFLINE)?offline_type:status;
if (st<8) st+=transport;
return st;
}
-//#ifdef PEP
+//#ifdef PEP
public void drawItem(Graphics g, int ofs, boolean sel) {
int w=g.getClipWidth();
int h=g.getClipHeight();
int xo=g.getClipX();
int yo=g.getClipY();
-
+
if (pepMood>=0) {
ImageList moods=MoodIcons.getInstance();
w-=moods.getWidth();
moods.drawImage(g, pepMood, w,0);
}
+ //#if PEP_TUNE
if (pepTune) {
w-=il.getWidth();
il.drawImage(g, RosterIcons.ICON_PROFILE_INDEX+3, w,0);
}
+ //#endif
g.setClip(xo, yo, w, h);
super.drawItem(g, ofs, sel);
}
-//#endif
+//#endif
public int getNewMsgsCount() {
if (getGroupType()==Groups.TYPE_IGNORE) return 0;
@@ -199,7 +224,19 @@
//public boolean needsCount(){ return (newMsgCnt<0); }
public boolean active(){
- return isActive;
+ //if (msgs.size()>1) return true;
+ if (msgs.size()==0) return false;
+ //return (((Msg)msgs.elementAt(0)).messageType!=Msg.MESSAGE_TYPE_PRESENCE);
+ for (Enumeration e=msgs.elements(); e.hasMoreElements(); ) {
+ Msg m=(Msg)e.nextElement();
+ if (m.messageType!=Msg.MESSAGE_TYPE_PRESENCE
+//#if PEP
+ && m.messageType!=Msg.MESSAGE_TYPE_MOOD
+//#endif
+ ) return true;
+ }
+ return false;
+ //return isActive; //<-voffk>
}
public void resetNewMsgCnt() { newMsgCnt=-1;}
@@ -232,51 +269,19 @@
if (msgs.size()==1)
if ( ((Msg)msgs.firstElement()).isPresence())
if (origin!=ORIGIN_GROUPCHAT) first_replace=true;
-//#if USE_SIEMENS_FILES
-//# Config cf=Config.getInstance();
-//#
-//# if (cf.msgLog && group.index!=Groups.TYPE_TRANSP && group.index!=Groups.TYPE_SEARCH_RESULT)
-//# {
-//# String histRecord=(nick==null)?getBareJid():nick;
-//# String fromName=StaticData.getInstance().account.getUserName();
-//# if (m.messageType!=Msg.MESSAGE_TYPE_OUT) fromName=toString();
-//# boolean allowLog=false;
-//# switch (m.messageType) {
-//# case Msg.MESSAGE_TYPE_PRESENCE:
-//# if (origin>=ORIGIN_GROUPCHAT && cf.msgLogConfPresence) allowLog=true;
-//# if (origin=ORIGIN_GROUPCHAT && cf.msgLogConf) allowLog=true;
-//# if (origin ");
-//# if (m.subject!=null) {
-//# body.append(m.subject);
-//# body.append("\r\n");
-//# }
-//# body.append(m.getBody());
-//# body.append("\r\n");
-//# io.NvStorage.appendFile("Log_"+histRecord, body.toString());
-//# }
-//# }
-//#endif
+
+ if (cf.autoScroll) moveToLatest=true; //<+voffk: autoscrolling>
+
if (first_replace) {
msgs.setElementAt(m,0);
return;
}
msgs.addElement(m);
- if ( (m.messageType!=Msg.MESSAGE_TYPE_PRESENCE)
- && (m.messageType!=Msg.MESSAGE_TYPE_HISTORY) ) {
+ /*if ( (m.messageType!=Msg.MESSAGE_TYPE_PRESENCE)
+ && (m.messageType!=Msg.MESSAGE_TYPE_MOOD) ) {
isActive=true;
- }
+ }*/ //<-voffk>
if (m.unread) {
lastUnread=msgs.size()-1;
@@ -346,7 +351,7 @@
msgs=new Vector();
vcard=null;
resetNewMsgCnt();
- isActive=false;
+ //isActive=false; //<-voffk>
}
public final void setSortKey(String sortKey){
@@ -390,4 +395,43 @@
if (m.id.equals(id)) m.delivered=true;
}
}
+
+ //
+ public final void smartPurge(int cursor) {
+ try {
+ if (cursor==msgs.size())
+ msgs=new Vector();
+ else
+ for (int i=0; i
}
Index: bombus-plus/export/trunk/src/Client/Group.java
===================================================================
--- bombus-plus/export/trunk/src/Client/Group.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/Group.java (working copy)
@@ -26,6 +26,7 @@
*/
package Client;
+import Conference.MucContact; //
import com.alsutton.jabber.datablocks.Presence;
import images.RosterIcons;
import java.util.*;
@@ -44,6 +45,7 @@
protected int nContacts;
protected int onlines;
public int imageExpandedIndex=RosterIcons.ICON_EXPANDED_INDEX;
+ public int imageCollapsedIndex=RosterIcons.ICON_COLLAPSED_INDEX; //
public Vector contacts;
@@ -63,7 +65,7 @@
public int getColor(){ return Colors.GROUP_INK; }
public int getImageIndex() {
return collapsed?
- RosterIcons.ICON_COLLAPSED_INDEX
+ /*RosterIcons.ICON_COLLAPSED_INDEX*/imageCollapsedIndex //
:imageExpandedIndex;
}
@@ -101,10 +103,10 @@
|| type==Groups.TYPE_NOT_IN_LIST
|| type==Groups.TYPE_TRANSP
|| c.origin==Contact.ORIGIN_GROUPCHAT
+ || c instanceof MucContact //
)
contacts.addElement(c);
}
-
void finishCount() {
//contacts=tcontacts;
onlines=tonlines;
Index: bombus-plus/export/trunk/src/Client/ContactMessageList.java
===================================================================
--- bombus-plus/export/trunk/src/Client/ContactMessageList.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/ContactMessageList.java (working copy)
@@ -37,6 +37,10 @@
import ui.*;
import java.util.*;
import javax.microedition.lcdui.*;
+//#ifdef CLIPBOARD
+//# import util.ClipBoard; //
+//#endif
+
/**
*
* @author Eugene Stahov
@@ -56,15 +60,27 @@
Command cmdPurge=new Command(SR.MS_CLEAR_LIST, Command.SCREEN, 10);
Command cmdContact=new Command(SR.MS_CONTACT,Command.SCREEN,11);
Command cmdActive=new Command(SR.MS_ACTIVE_CONTACTS,Command.SCREEN,11);
-
+
+//#ifdef CLIPBOARD
+//# Command cmdSendBuffer=new Command(SR.MS_SEND_CLIPBOARD, Command.SCREEN, 15);
+//# private ClipBoard clipboard;
+//#endif
+
StaticData sd;
+ private Config cf=Config.getInstance(); //
+
/** Creates a new instance of MessageList */
public ContactMessageList(Contact contact, Display display) {
super(display);
this.contact=contact;
sd=StaticData.getInstance();
+//#ifdef CLIPBOARD
+//# if (cf.useClipBoard)
+//# clipboard=ClipBoard.getInstance();
+//#endif
+
Title title=new Title(contact);
setTitleItem(title);
@@ -81,13 +97,14 @@
addCommand(cmdActive);
addCommand(cmdQuote);
addCommand(cmdArch);
-
if (contact instanceof MucContact && contact.origin==Contact.ORIGIN_GROUPCHAT) {
addCommand(cmdReply);
}
setCommandListener(this);
moveCursorTo(contact.firstUnread());
+ ///moveCursorTo(contact.breakPoint+1,true);///save cursor pos - voffk
//setRotator();
+ contact.setIncoming(Contact.INC_NONE); //
}
public void showNotify(){
@@ -108,10 +125,24 @@
removeCommand(cmdUnsubscribed);
}
} catch (Exception e) {}
-
+//#ifdef CLIPBOARD
+//# if (!clipboard.isEmpty() && cf.useClipBoard) {
+//# addCommand(cmdSendBuffer);
+//# }
+//#endif
+
}
protected void beginPaint(){
+ //
+ markRead(cursor);
+ if (cursor==(messages.size()-1)) {
+ if (contact.moveToLatest) {
+ contact.moveToLatest=false;
+ moveCursorEnd();
+ }
+ }
+ //
getTitleItem().setElementAt(sd.roster.getEventIcon(), 2);
getTitleItem().setElementAt((contact.vcard==null)?null:RosterIcons.iconHasVcard, 3);
//getTitleItem().setElementAt(contact.incomingComposing, 3);
@@ -119,12 +150,16 @@
public void markRead(int msgIndex) {
if (msgIndex>=getItemCount()) return;
- //Msg msg=getMessage(msgIndex);
- //if (msg.unread) contact.resetNewMsgCnt();
- //msg.unread=false;
if (msgIndex
+ if (contact.moveToLatest) {
+ contact.moveToLatest=false;
+ moveCursorEnd();
+ }
+ }
+
+ sd.roster.countNewMsgs();
}
@@ -140,6 +175,7 @@
public void focusedItem(int index){
markRead(index);
+ ///setBreakPoint(index);///save cursor pos - voffk
/*try {
Msg msg=(Msg) contact.msgs.elementAt(index);
if (msg.messageType==Msg.MESSAGE_TYPE_AUTH) addCommand(cmdSubscribe);
@@ -157,7 +193,8 @@
} catch (Exception e) {/*no messages*/}
}
if (c==cmdPurge) {
- clearMessageList();
+ //clearMessageList();
+ clearReadedMessageList();
}
/** login-critical section */
@@ -169,28 +206,30 @@
}
if (c==cmdResume) { keyGreen(); }
if (c==cmdQuote) {
- try {
- String msg=new StringBuffer()
- .append((char)0xbb) // »
- .append(getMessage(cursor).quoteString())
- .append("\n")
- .toString();
- new MessageEdit(display,contact,msg);
- } catch (Exception e) {/*no messages*/}
+ Quote();
+ //try {
+ // String msg=new StringBuffer()
+ // .append((char)0xbb) // »
+ // .append(getMessage(cursor).quoteString())
+ // .append("\n")
+ // .toString();
+ //new MessageEdit(display,contact,msg);
+ //} catch (Exception e) {/*no messages*/}
}
if (c==cmdReply) {
- try {
- if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_OUT) return;
- if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_SUBJ) return;
+ Reply();
+ //try {
+ //if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_OUT) return;
+ //if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_SUBJ) return;
- Msg msg=getMessage(cursor);
- /*String body=msg.toString();
- int nickLen=body.indexOf(">");
- if (nickLen<0) nickLen=body.indexOf(" ");
- if (nickLen<0) return;*/
+ //Msg msg=getMessage(cursor);
+ // /*String body=msg.toString();
+ //int nickLen=body.indexOf(">");
+ //if (nickLen<0) nickLen=body.indexOf(" ");
+ //if (nickLen<0) return;*/
- new MessageEdit(display,contact,msg.from+": ");
- } catch (Exception e) {/*no messages*/}
+ //new MessageEdit(display,contact,msg.from+": ");
+ //} catch (Exception e) {/*no messages*/}
}
if (c==cmdContact) {
new RosterItemActions(display, contact, -1);
@@ -207,17 +246,47 @@
if (c==cmdUnsubscribed) {
sd.roster.sendPresence(contact.getBareJid(), "unsubscribed", null);
}
+//#ifdef CLIPBOARD
+//# if (c==cmdSendBuffer) {
+//# String from=sd.account.toString();
+//# String body=clipboard.getClipBoard();
+//# String subj=null;
+//#
+//# String id=String.valueOf((int) System.currentTimeMillis());
+//# Msg msg=new Msg(Msg.MESSAGE_TYPE_OUT,from,subj,body);
+//# msg.id=id;
+//#
+//# try {
+//# if (body!=null)
+//# sd.roster.sendMessage(contact, id, body, subj, null);
+//# contact.addMessage(new Msg(Msg.MESSAGE_TYPE_OUT,from,subj,"clipboard sended ("+body.length()+"chars)"));
+//# } catch (Exception e) {
+//# contact.addMessage(new Msg(Msg.MESSAGE_TYPE_OUT,from,subj,"clipboard NOT sended"));
+//# }
+//# redraw();
+//# }
+//#endif
+
}
-
- private void clearMessageList() {
+ //
+ /*private void clearMessageList() {
//TODO: fix scrollbar size
moveCursorHome();
contact.purge();
messages=new Vector();
System.gc();
redraw();
+ }*/
+ private void clearReadedMessageList() {
+ contact.smartPurge(cursor+1);
+ messages=new Vector();
+ ///contact.breakPoint=0;///save cursor pos - voffk
+ contact.lastUnread=getItemCount()-1;
+ moveCursorHome();
+ redraw();
}
+ //
public void keyGreen(){
if (!sd.roster.isLoggedIn()) return;
@@ -225,18 +294,112 @@
contact.msgSuspended=null;
}
- public void keyRepeated(int keyCode) {
+ //
+ /*public void keyRepeated(int keyCode) {
if (keyCode==KEY_NUM3) new ActiveContacts(display, contact);
else super.keyRepeated(keyCode);
+ }*/
+
+ protected void keyPressed(int keyCode) { //
+ if (keyCode==KEY_NUM4) {
+ if (cf.useTabs) nextContact(-1); else super.keyLeft();
+ return;
+ }
+ if (keyCode==KEY_NUM6) {
+ if (cf.useTabs) nextContact(1); else super.keyRight();
+ return;
+ }
+ super.keyPressed(keyCode);
}
-
- public void userKeyPressed(int keyCode) {
+
+ public void userKeyPressed(int keyCode) { //
super.userKeyPressed(keyCode);
- if (keyCode==keyClear) {
- if (messages.isEmpty()) return;
- new YesNoAlert(display, SR.MS_CLEAR_LIST, SR.MS_SURE_CLEAR, this);
+ if (keyCode==KEY_NUM3) new ActiveContacts(display, contact); //active contacts
+ if (keyCode==keyClear || keyCode=='0') //<+voffk: delete messages above the cursor>
+ if (cf.confirmDelete) new YesNoAlert(display, SR.MS_CLEAR_LIST, SR.MS_SURE_CLEAR, this);
+ else clearReadedMessageList();
+ if (keyCode=='#') { //reply
+ if (contact instanceof MucContact && contact.origin==Contact.ORIGIN_GROUPCHAT) {
+ Reply();
+ } else {
+ keyGreen();
+ }
}
+ if (keyCode==KEY_NUM9) { //quote
+ Quote();
+ }
}
-
- public void ActionConfirmed() { clearMessageList(); }
+
+ public void ActionConfirmed() { /*clearMessageList();*/ clearReadedMessageList(); }
+
+ private void Reply() { //
+ try {
+ if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_OUT) return;
+ if (getMessage(cursor).messageType == Msg.MESSAGE_TYPE_SUBJ) return;
+ Msg msg=getMessage(cursor);
+ new MessageEdit(display, contact, msg.from+": ");
+ } catch (Exception e) {/*no messages*/}
+ }
+
+ private void Quote() { //
+ /*try { //without kostyl
+ StringBuffer msg=new StringBuffer();
+ .append(getMessage(cursor).quoteString())
+ .append("\n// ")
+ .toString();
+ new MessageEdit(display, contact, msg);
+ msg=null;
+ } catch (Exception e) { }
+ }*/
+ try { //
+ StringBuffer msg=new StringBuffer();
+ if (getMessage(cursor).messageType != Msg.MESSAGE_TYPE_SUBJ) {
+ msg.append(getMessage(cursor).quoteString());
+ msg.append("\n// ");
+ } else {
+ msg.append(quoteMucSubject(getMessage(cursor).quoteString()));
+ }
+ new MessageEdit(display, contact, msg.toString());
+ msg=null;
+ } catch (Exception e) {/*no messages*/}
+ }
+
+ private static String quoteMucSubject(String text) { //
+ String result=text;
+ if (result!=null && result.length()>0) {//??????????
+ int startpos=result.indexOf(": ", 0);
+ if (startpos!=-1) {
+ result=result.substring(startpos+2);
+ };
+ }
+ return result;
+ }
+
+ private void nextContact(int direction){//
+ Vector activeContacts=new Vector();
+ int nowContact=-1, contacts=-1;
+ for (Enumeration r=StaticData.getInstance().roster.getHContacts().elements(); r.hasMoreElements(); ) {
+ Contact c=(Contact)r.nextElement();
+ if (c.active()) {
+ contacts++;
+ if (c==contact) nowContact=contacts;
+ activeContacts.addElement(c);
+ }
+ }
+ int size=activeContacts.size();
+
+ if (size==0) return;
+
+ try {
+ nowContact+=direction;
+ if (nowContact<0) nowContact=size-1;
+ if (nowContact>=size) nowContact=0;
+ Contact c=(Contact)activeContacts.elementAt(nowContact);
+ new ContactMessageList((Contact)c,display).setParentView(StaticData.getInstance().roster);
+ } catch (Exception e) { }
+ }
+
+ ///private void setBreakPoint(int index) {///save cursor pos - voffk
+ ///contact.breakPoint=index;
+ ///}
}
Index: bombus-plus/export/trunk/src/Client/AccountSelect.java
===================================================================
--- bombus-plus/export/trunk/src/Client/AccountSelect.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/AccountSelect.java (working copy)
@@ -1,5 +1,5 @@
/*
- * AccountPicker.java
+ * AccountSelect.java
*
* Created on 19.03.2005, 23:26
*
@@ -27,7 +27,7 @@
*/
package Client;
-import images.RosterIcons;
+//import images.RosterIcons;
import io.NvStorage;
import locale.SR;
import midlet.Bombus;
@@ -44,7 +44,7 @@
*/
public class AccountSelect
extends VirtualList
- implements CommandListener{
+ implements CommandListener, YesNoAlert.YesNoListener /*voffk*/{
Vector accountList;
int activeAccount;
@@ -57,7 +57,7 @@
Command cmdCancel=new Command(SR.MS_BACK,Command.BACK,99);
Command cmdQuit=new Command(SR.MS_APP_QUIT,Command.SCREEN,10);
- /** Creates a new instance of AccountPicker */
+ /** Creates a new instance of AccountSelect */
public AccountSelect(Display display, boolean enableQuit) {
super();
//this.display=display;
@@ -75,16 +75,19 @@
accountList.addElement(a);
a.active=(activeAccount==index);
index++;
- }
- } while (a!=null);
- if (accountList.isEmpty()) {
+ }
+ } while (a!=null);
+
+ /*if (accountList.isEmpty()) {
a=Account.createFromJad();
if (a!=null) {
- //a.updateJidCache();
accountList.addElement(a);
rmsUpdate();
}
- }
+ }*/ //
+
+ moveCursorTo(activeAccount); //<+voffk>
+
attachDisplay(display);
addCommand(cmdAdd);
@@ -120,6 +123,7 @@
Bombus.getInstance().notifyDestroyed();
}
if (c==cmdCancel) {
+ if (StaticData.getInstance().account==null) StaticData.getInstance().account=Account.createFromStorage(Config.getInstance().accountIndex); //<*voffk: Uncaught NullPointerExceptionexception if account==null :)>
destroyView();
//Account.launchAccount();
//StaticData.getInstance().account_index=0;
@@ -130,17 +134,13 @@
if (c==cmdAdd) {
new AccountForm(this, display, null);
}
- if (c==cmdDel) {
+ if (c==cmdDel) { //
{
Config cf=Config.getInstance();
if (cf.accountIndex>cursor) cf.accountIndex--;
cf.saveToStorage();
}
- accountList.removeElement(getFocusedObject());
- rmsUpdate();
- moveCursorHome();
- commandState();
- redraw();
+ new YesNoAlert(display, SR.MS_DELETE, "Are you sure want to delete this account?", this);
}
}
@@ -163,4 +163,11 @@
NvStorage.writeFileRecord(outputStream, Account.storage, 0, true);
}
+ public void ActionConfirmed() { //
+ accountList.removeElement(getFocusedObject());
+ rmsUpdate();
+ moveCursorHome();
+ commandState();
+ redraw();
+ }
}
Index: bombus-plus/export/trunk/src/Client/Account.java
===================================================================
--- bombus-plus/export/trunk/src/Client/Account.java (revision 1363)
+++ bombus-plus/export/trunk/src/Client/Account.java (working copy)
@@ -58,7 +58,11 @@
private int port=5222;
public boolean active;
private boolean useSSL;
+//#if NONSASL_ENABLE
+//# private boolean sasl=true;
+//#else
private boolean compression;
+//#endif
private boolean plainAuth;
private boolean mucOnly;
@@ -69,9 +73,11 @@
private String proxyHostAddr;
private int proxyPort;
- public int keepAlivePeriod=200;
+ public int keepAlivePeriod=400; //<*voffk>
public int keepAliveType=1;
+ public int defstatus; //<+voffk>
+
//private String jid;
/** Creates a new instance of Account */
@@ -85,12 +91,18 @@
if (a!=null) {
sd.roster.logoff();
sd.roster.resetRoster();
- if (launch) sd.roster.sendPresence(Presence.PRESENCE_ONLINE);
+ //if (launch) sd.roster.sendPresence(Presence.PRESENCE_ONLINE); //<*voffk>
+ if (launch)
+ if (Config.getInstance().def_status==5) {
+ sd.roster.sendPresence(Presence.PRESENCE_INVISIBLE, null);
+ } else {
+ sd.roster.sendPresence(Config.getInstance().def_status, null);
+ }
}
return a;
}
- public static Account createFromJad(){
+ /*public static Account createFromJad(){
Account a=new Account();
MIDlet m=Bombus.getInstance();
try {
@@ -101,7 +113,7 @@
} catch (Exception e) { }
if (a.server==null) return null;
return a;
- }
+ }*/ //<-voffk>
public static Account createFromDataInputStream(DataInputStream inputStream){
@@ -132,7 +144,11 @@
}
if (version>=6)
+//#if NONSASL_ENABLE
+//# a.sasl=inputStream.readBoolean();
+//#else
a.compression=inputStream.readBoolean();
+//#endif
if (version>=7) {
a.keepAliveType=inputStream.readInt();
@@ -207,9 +223,11 @@
outputStream.writeBoolean(enableProxy);
outputStream.writeUTF(proxyHostAddr);
outputStream.writeInt(proxyPort);
-
+//#if NONSASL_ENABLE
+//# outputStream.writeBoolean(sasl);
+//#else
outputStream.writeBoolean(compression);
-
+//#endif
outputStream.writeInt(keepAliveType);
outputStream.writeInt(keepAlivePeriod);
@@ -290,7 +308,13 @@
//# proxy="socket://" + getProxyHostAddr() + ':' + getProxyPort();
//#endif
}
- return new JabberStream( getServer(), url.toString(), true, proxy);
+ return new JabberStream( getServer(), url.toString(),
+//#if NONSASL_ENABLE
+//# sasl,
+//#else
+ true,
+//#endif
+ proxy);
}
public boolean isEnableProxy() {
@@ -317,14 +341,24 @@
this.proxyPort = proxyPort;
}
+//#if NONSASL_ENABLE
+//# public boolean isSASL() { return sasl; }
+//# public void setSasl(boolean sasl) { this.sasl = sasl; }
+//#else
public boolean useCompression() { return compression; }
public void setUseCompression(boolean value) { this.compression = value; }
-
+//#endif
+
public boolean useGoogleToken() {
if (useSSL) return false;
/*if (hostAddr==null) return false;
if (hostAddr.indexOf("google")<0) return false; */
+//#if NONSASL_ENABLE
+//# if (!server.startsWith("gmail.com")) return false;
+//# return isSASL();
+//#else
return (server.startsWith("gmail.com"));
+//#endif
}
}
Index: bombus-plus/export/trunk/build.xml
===================================================================
--- bombus-plus/export/trunk/build.xml (revision 1363)
+++ bombus-plus/export/trunk/build.xml (working copy)
@@ -15,26 +15,54 @@
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -86,13 +114,21 @@
+
+
+
+
+
-
+
+
Index: bombus-plus/export/trunk/resources/version.properties
===================================================================
--- bombus-plus/export/trunk/resources/version.properties (revision 1363)
+++ bombus-plus/export/trunk/resources/version.properties (working copy)
@@ -1,4 +1,5 @@
# version pattern
bombus.revision=$WCREV$
-bombus.version=0.7.$WCREV$
+bombus.version=0.7.1363.$WCREV$
bombus.midlet=0.7
+# bombus.builddate=$BUILDDATE$
Index: bombus-plus/export/trunk/resources/text/lang/ru.txt
===================================================================
--- bombus-plus/export/trunk/resources/text/lang/ru.txt (revision 1363)
+++ bombus-plus/export/trunk/resources/text/lang/ru.txt (working copy)
@@ -1,20 +1,10 @@
-// Russian langfile for Bombus - mobile jabber client
-// Copyright (c) 2005-2008, Eugene Stahov (evgs), http://bombus-im.org . All rights reserved.
-// (c) Alexey V.Lubimov , 2006.
-// (c) Vladimir N. Shelukhin , 2006-2008.
-// (c) Vladimir A. Kichigin , 2007-2008.
-
-// ask server to send us localized messages
+//ru.txt for bombus-plus by voffk
xmlLang ru
-
-//463
Jid Jid
Privacy Lists Списки приватности
Message font Шрифт сообщения
Roster font Шрифт ростера
-Paste Body Встав. тело сообщения
Configure Room Конфигуратор комнаты
-Paste Subject Встав. тему сообщения
Service Discovery Обзор сервисов
User JID JID пользователя
New list Новый список
@@ -24,8 +14,8 @@
Modify Изменить
Update Обновить
Account name Имя аккаунта
-GMT offset Часовой пояс (GMT+)
-Time settings (hours) Настройки времени
+GMT offset, ±hours Часовой пояс, ±час. (GMT±xx)
+Clock offset, ±hours Дополнит. смещ. времени, ±час.
Connected Соединение установлено
Connect to Соединение с
Alert Profile Сигналы
@@ -110,18 +100,17 @@
at Host Сервер
join conferences автовход в конференции
Status Статус
-Smiles Вкл/выкл смайлики
Contact > Контакт >
offline contacts показать отключенных
Transport Транспорт
-composing events извещения о наборе текста
-Add Smile Встав. смайлик
+composing events сигналы о наборе текста
+Add Smile Смайлы
Nickname Ник
Revoke Voice Отнять право голоса
Commands Команды
- (Sign) - (знак)
Set default Уст. по умолчанию
-Outcasts (Ban) Изгои (Ban)
+Outcasts (Ban) Бан
Set affiliation to Изменить членство на
Register Account Зарегистрировать аккаунт
autologin автосоединение
@@ -136,7 +125,6 @@
Cancel Отмена
Close Закрыть
Archive Архив
-free свободно
Conference Конференция
Sound Звук
Login failed Ошибка авторизации
@@ -159,7 +147,6 @@
for all status types для всех статусов
Paste Jid Вставить Jid
Goto URL Перейти к URL
-Clock offset Смещение часов
flash backlight мигать подсветкой
Suspend Отложить
Resume Message Черновик
@@ -167,13 +154,9 @@
My vCard Личная vCard
transports транспорты
New Account Новый аккаунт
-self-contact свои контакты
-vCard vCard
Set Subject Установить тему
Tools Инструменты
Port Порт
-
-//473
Connect Подключиться
history - история -
Are You sure want to discard Вы действительно собираетесь понизить у
@@ -182,17 +165,13 @@
// DO NOT TRANSLATE THIS LINES!!!
Ignore-List Ignore-List
-Not-in-list Not-in-list
+General General
Stanzas Stanzas
-//476
-Clear Очистить
-//494
+Clear Очистить
Ask subscription Запросить подписку
Grant subscription Разрешить подписку
-
-//502
Invite to conference Пригласить в конференцию
Reason Причина
You have been invited to Вы были приглашены в
@@ -204,23 +183,19 @@
Grant Admin Дать право администратора
Grant Ownership Дать право владельца
room presences статусы в конференции
-
is now known as сменил ник на
was banned запретили входить в данную конференцию
was kicked выгнали из конференции
has been kicked because room became members-only выгнан, т.к. конференция теперь только для членов
- has left the channel вышел из конференции
- has joined the channel as подключился как
+ has left the room вышел из конференции
+ has joined the room as подключился как
and и
is now теперь
-
Participants Участники
Abc Абв
-
-//1063
autofocus автофокус
Grant Membership Дать членство
-Are You sure want to clear messagelist? Вы уверены, что хотите очистить список сообщений?
+Delete the messages above the cursor? Удалить сообщения выше курсора?
Google token request Запрос рукопожатия у Google
SASL login SASL-логин
Features Возможности
@@ -238,8 +213,7 @@
Info Инфо
Reply Ответить
Send status Установить статус
-Are you sure want to BAN this person? Вы уверены, что хотите запретить вход данному пользователю?
-No reason Без причины
+Are you sure want to BAN this person? Вы уверены, что хотите забанить данного пользователя?
Recent История ввода
Shot Снять
Select file Выбрать файл
@@ -248,32 +222,21 @@
Camera Камера
Hide finished Скрыть завершённые
Transfer tasks Менеджер передачи файлов
-Are you sure want to delete this message? Вы уверены, что хотите удалить данное сообщение?
+Are you sure want to delete this message? Удалить данное сообщение?
New conference Новая конференция
Root Корень диска
Decline Отклонить
-Authorize new contacts Автоматическая авторизация
+authorize new contacts автоматич. авторизация
[auto-subscribe] [автоподписка]
Keep-Alive Тип Keep-Alive
has been unaffiliated and kicked from members-only room был лишён полномочий и выгнан, т.к. конференция только для членов
-Minutes before away Таймер автостатуса (минуты)
+Minutes before away Таймер автостатуса, мин
Automatic Away Автосмена статуса
disabled выключено
keyblock / flip блок / флип
idle бездействие
-Add autojoin bookmark Закладка с автовходом
+Add autojoin bookmark Добав. закладку с автовходом
-//2007-04-12
-//role роль
-//affiliation полномочия
-//visitor гость
-//participant участник
-//moderator модератор
-//owner владелец
-//admin администратор
-//member член конференции
-
-//2007-08-19
online доступен
free for chat готов поболтать
away отсутствует
@@ -281,23 +244,14 @@
invisible невидим
do not disturb не беспокоить
offline отключен
-Join marked (auto) Подключ. к отмеченным для автовхода
+Join marked (auto) Подключ. к отмеч. для автовхода
shared platform info показывать модель устройства
delivery events отчёты о доставке
-drop all не принимать ничего
-receive messages принимать сообщения
-messages & presences сообщения и присутствия
normal обычный
small мелкий
large крупный
File Transfers Передача файлов
-Auto Автоматически
-All signals Все сигналы
-Vibra Вибрация
-No signals Без сигналов
- (default) (по умолчанию)
-//2007-10-24 voffk
Message collapse limit Сворачивать сообщения больше
This user wants to subscribe to your presence Запрос подписки на присутствие
You are now authorized Вы получили подписку
@@ -313,27 +267,36 @@
Save to Сохранить как
Sender: Отправитель:
size: размер:
-
-//2007-11-07 zet
-Automatic subscription автоподписка
-Ask me спросить меня
-Drop subscription отклонять
-Deny subscription запрещать
-Search Поиск
-Register Регистрация
Color theme Цветовая тема
-Memory: Память:
-Free= Свободно=
-Total= Всего=
Versions Версии
Install Установить
Available versions Доступные версии
User Пользователь
-
-//2008-05-04 zet
-No compression без сжатия
-New room created Новая конференция создана
+no compression без сжатия траффика
+New room created Создана новая конференция
Browse rooms Просмотр конференций
-Personal events Персональные уведомления
User Mood Настроение
Personal events not supported Персональные уведомления не поддерживаются
+
+//voffk
+Paste Вставить
+Unsubscribe from presences Отписаться от статусов
+last appeared contacts недавно появившиеся контакты
+Save photo to ... Сохранить фото в ...
+Previous status Предыдущий статус
+Time Время
+Idle Бездействие
+Sound volume Громкость звука
+Reconnects count Попытки реконнекта
+Save to dir ... Сохранить в папку ...
+Import from file Загрузить из файла
+emulate tabs эмулировать вкладки
+clipboard буфер обмена
+Copy Копировать
+confirmation for deleting messages подтверждения при удалении сообщений
+counter of traffic счётчик траффика
+list of accounts список аккаунтов
+Replace transport Сменить транспорт
+auto-scrolling автопрокрутка
+Send clipboard Послать текст из буффера
+Save Сохранить
\ No newline at end of file
Index: bombus-plus/export/trunk/resources/text/lang/res.txt
===================================================================
--- bombus-plus/export/trunk/resources/text/lang/res.txt (revision 1363)
+++ bombus-plus/export/trunk/resources/text/lang/res.txt (working copy)
@@ -1,8 +1,2 @@
en null English
ru /lang/ru.txt Russian
-pl /lang/pl.txt Polish
-cz /lang/cz.txt Czech
-sk /lang/sk.txt Slovak
-uk /lang/uk.txt Ukrainian
-bg /lang/bg.txt Bulgarian
-id /lang/id.txt Indonesian
Index: bombus-plus/export/trunk/resources/text/def_bookmarks.txt
===================================================================
--- bombus-plus/export/trunk/resources/text/def_bookmarks.txt (revision 1363)
+++ bombus-plus/export/trunk/resources/text/def_bookmarks.txt (working copy)
@@ -1,3 +1,5 @@
+bombus-plus@conference.jabbus.org
+bombus@conference.jabber.ru
+newbie@conference.jabber.ru
bombus-talks@conference.jabber.ru
-bombus@conference.jabber.ru
bombus-english@conference.jabber.ru
Index: bombus-plus/export/trunk/resources/pep/images/moods.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: bombus-plus/export/trunk/resources/themes/themes/res.txt
===================================================================
--- bombus-plus/export/trunk/resources/themes/themes/res.txt (revision 1363)
+++ bombus-plus/export/trunk/resources/themes/themes/res.txt (working copy)
@@ -1,7 +1,7 @@
null default
/themes/tkabber.txt Tkabber
/themes/opera.txt Opera
-/themes/summer.txt Summer
-/themes/newyear.txt NewYear
-/themes/night.txt Night
-/themes/water.txt Water
\ No newline at end of file
+/themes/bombusmod.txt BombusMod
+/themes/emo.txt Emo
+/themes/halloween.txt Halloween
+/themes/walkman.txt Walkman
Index: bombus-plus/export/trunk/resources/themes/themes/tkabber.txt
===================================================================
--- bombus-plus/export/trunk/resources/themes/themes/tkabber.txt (revision 1363)
+++ bombus-plus/export/trunk/resources/themes/themes/tkabber.txt (working copy)
@@ -20,13 +20,12 @@
MESSAGE_IN 0x000000
MESSAGE_OUT 0xa90909
MESSAGE_PRESENCE 0x000000
+//with _S must be updated
+MESSAGE_IN_S 0x000000
+MESSAGE_OUT_S 0xa90909
+MESSAGE_PRESENCE_S 0x000000
MESSAGE_AUTH 0x000000
MESSAGE_HISTORY 0x000000
-CURSOR_BGND 0x8c8c8c
-CURSOR_OUTLINE 0x000000
-SCROLL_BRD 0x565656
-SCROLL_BAR 0x929292
-SCROLL_BGND 0x727272
PGS_REMAINED 0xd0d1d1
PGS_COMPLETE 0x7d7d7d
PGS_BORDER 0x000000
@@ -34,7 +33,8 @@
HEAP_TOTAL 0xdadada
//voffk
HEAP_FREE 0x000000
-//with _S must be updated
-MESSAGE_IN_S 0x000000
-MESSAGE_OUT_S 0xa90909
-MESSAGE_PRESENCE_S 0x000000
\ No newline at end of file
+CURSOR_BGND 0x8c8c8c
+CURSOR_OUTLINE 0x000000
+SCROLL_BRD 0x565656
+SCROLL_BAR 0x929292
+SCROLL_BGND 0x727272
\ No newline at end of file
Index: bombus-plus/export/trunk/resources/MIDP2/images/smiles.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: bombus-plus/export/trunk/resources/MIDP2/images/mrim.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: bombus-plus/export/trunk/resources/MIDP2/images/skin.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: bombus-plus/export/trunk/resources/MIDP2/images/smiles.txt
===================================================================
--- bombus-plus/export/trunk/resources/MIDP2/images/smiles.txt (revision 1363)
+++ bombus-plus/export/trunk/resources/MIDP2/images/smiles.txt (working copy)
@@ -1,31 +1,31 @@
-:-) :)
-;-) ;)
-:-P :-p :P :p
-:-D :-d :D :d :-> :> :lol: :LOL: *LOL* *lol* :))
-:-( :( ;-( ;( :((
+:) :-)
+;) ;-)
+:-P :-p :P :p
+:-D :-d :D :d :-> :> :lol: :LOL: *LOL* *lol* :)) :)))
+:( :-( ;-( ;( :((
:'( :'-( 8(
-:-O :-o :O :o =-O :-0 8-O
-:-@ :@ >:o
-:-$ :$ *KISSED* :") :-[ *SORRY* *sorry*
+:-O :-o :O :o =-O :-0 8-O
+%) %-) *CRAZY* *crazy* *ROFL* rofl
+:-$ :$ *KISSED* :") :-[ *SORRY* *sorry* *PARDON*
:-| :|
-:-S :-s :S :s
-B-) (H) (h) 8-)
-(Y) (y) *THUMBS UP* *THUMBS_UP*
-(N) (n) *THUMBS DOWN* *THUMBS_DOWN* *STOP*
-(6) ]:->
-(B) (b) *DRINK* :drink: *BEER*
-(%)
+:-S :-s :S :s
+8-) B-) (H) (h)
+(Y) (y) *YES* *THUMBS UP* *THUMBS_UP*
+(N) (n) *NO* *THUMBS DOWN* *THUMBS_DOWN*
+:-* :* =* *KISSING*
+@}->-- @};- @}->- (f) (F) *BOUQUET*
+*DRINK* (B) (b) *BEER*
(D) (d)
->:) >:-) >:D >:-D
-:-B
+:O) :o) *JOKINGLY* :0) :-]
+:-B *BOTAN*
:-? :? *dntknw* *DONT_KNOW*
*-:)
8-X 8-x @= *horror*
-:O) :o) *JOKINGLY* :0) :-]
+:-\ :-/ :/ :\
:-& :-X :-x :-! :! *SUP*
-|-) |) *TIRED*
+|-) |) *TIRED* *SLEEP* 3-|{
(C) ~o) ~O)
:-"
-:-* :* =* *KISSING*
-@}->-- @};- @}->- (f) (F) *BOUQUET*
-:-\ :-/ :/ :\
+(6) ]:->
+>:) >:-) >:D >:-D
+:-@ :@ >:o
Index: bombus-plus/export/trunk/resources/MIDP2/images/splash.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: bombus-plus/export/trunk/resources/MIDP2/images/transports.txt
===================================================================
--- bombus-plus/export/trunk/resources/MIDP2/images/transports.txt (revision 1363)
+++ bombus-plus/export/trunk/resources/MIDP2/images/transports.txt (working copy)
@@ -1,8 +1,15 @@
+muc#vis /images/visitors.png
+aol /images/aim.png
aim /images/aim.png
+msn /images/msn.png
+yahoo /images/yahoo.png
icq /images/icq.png
+icq2 /images/icq.png
jit /images/icq.png
-msn /images/msn.png
mrim /images/mrim.png
rss /images/rss.png
-yahoo /images/yahoo.png
-muc#vis /images/visitors.png
\ No newline at end of file
+news /images/rss.png
+j2j /images/j2j.png
+j3j /images/j2j.png
+g2j /images/j2j.png
+gtalk /images/j2j.png
\ No newline at end of file
Index: bombus-plus/export/trunk/resources/MIDP2/sounds/res.txt
===================================================================
--- bombus-plus/export/trunk/resources/MIDP2/sounds/res.txt (revision 1363)
+++ bombus-plus/export/trunk/resources/MIDP2/sounds/res.txt (working copy)
@@ -1,7 +1,9 @@
//type path desc
-audio/amr /sounds/message.amr message.amr
-audio/x-wav /sounds/message.wav message.wav
-audio/midi /sounds/message.mid message.mid
-//audio/mp3 /sounds/message.mp3 message.mp3
+audio/mp3 /sounds/ow-vinni-pooh.mp3 ow-vinni-pooh.mp3
+audio/amr /sounds/person.amr person.amr
+audio/midi /sounds/000.mid 000.mid
+audio/midi /sounds/chat.mid chat.mid
+audio/midi /sounds/online.mid online.mid
+//audio/x-wav /sounds/message.wav message.wav
audio/x-tone-seq /sounds/mary.seq mary.seq
tone tone sequence