Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo
@@ -1,6 +1,7 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
<component name="InspectionProjectProfileManager">
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="AndroidLintRtlHardcoded" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
|
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
|
||||||
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
|
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
|
||||||
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
|
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
|
||||||
|
|||||||
@@ -84,7 +84,6 @@
|
|||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/jars" />
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ android {
|
|||||||
|
|
||||||
dexOptions {
|
dexOptions {
|
||||||
maxProcessCount 2
|
maxProcessCount 2
|
||||||
javaMaxHeapSize "2g"
|
javaMaxHeapSize "3g"
|
||||||
}
|
}
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "beyondsoft.bewomitarbeiterapp"
|
applicationId "beyondsoft.bewomitarbeiterapp"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="beyondsoft.bewomitarbeiterapp">
|
package="beyondsoft.bewomitarbeiterapp">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.CALL_PHONE"/>
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
private static final String LOGTAG = "DATABASE_HANDLER";
|
private static final String LOGTAG = "DATABASE_HANDLER";
|
||||||
|
|
||||||
//DataBase version
|
//DataBase version
|
||||||
private static final int DATABASE_VERSION = 12;
|
private static final int DATABASE_VERSION = 13;
|
||||||
|
|
||||||
//Database name
|
//Database name
|
||||||
private static final String DATABASE_NAME = "Contacts_Manager";
|
private static final String DATABASE_NAME = "Contacts_Manager";
|
||||||
@@ -70,6 +70,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
private static final String KEY_TEAM_MEMBER_NAMES = "teammembernames";
|
private static final String KEY_TEAM_MEMBER_NAMES = "teammembernames";
|
||||||
private static final String KEY_VERSION = "version";
|
private static final String KEY_VERSION = "version";
|
||||||
private static final String KEY_IS_EMPLOYEE = "isemployee";
|
private static final String KEY_IS_EMPLOYEE = "isemployee";
|
||||||
|
private static final String KEY_PHONENUMBER = "phonenumber";
|
||||||
|
|
||||||
private static final String[] CONTACTS_COLUMNS = new String[] {
|
private static final String[] CONTACTS_COLUMNS = new String[] {
|
||||||
KEY_ID,
|
KEY_ID,
|
||||||
@@ -79,7 +80,8 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
KEY_TEAM_MEMBER_OIDS,
|
KEY_TEAM_MEMBER_OIDS,
|
||||||
KEY_TEAM_MEMBER_NAMES,
|
KEY_TEAM_MEMBER_NAMES,
|
||||||
KEY_VERSION,
|
KEY_VERSION,
|
||||||
KEY_IS_EMPLOYEE
|
KEY_IS_EMPLOYEE,
|
||||||
|
KEY_PHONENUMBER
|
||||||
};
|
};
|
||||||
|
|
||||||
// ChatMessage-Tabelle
|
// ChatMessage-Tabelle
|
||||||
@@ -162,7 +164,8 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
KEY_TEAM_MEMBER_NAMES + " TEXT, " +
|
KEY_TEAM_MEMBER_NAMES + " TEXT, " +
|
||||||
KEY_TEAM_MEMBER_OIDS + " TEXT, " +
|
KEY_TEAM_MEMBER_OIDS + " TEXT, " +
|
||||||
KEY_VERSION + " INTEGER, " +
|
KEY_VERSION + " INTEGER, " +
|
||||||
KEY_IS_EMPLOYEE + " INTEGER)";
|
KEY_IS_EMPLOYEE + " INTEGER, " +
|
||||||
|
KEY_PHONENUMBER + " TEXT)";
|
||||||
|
|
||||||
db.execSQL(CREATE_CONTACTS_TABLE);
|
db.execSQL(CREATE_CONTACTS_TABLE);
|
||||||
|
|
||||||
@@ -360,6 +363,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
values.put(KEY_TEAM_MEMBER_OIDS, contact.teamMemberOids);
|
values.put(KEY_TEAM_MEMBER_OIDS, contact.teamMemberOids);
|
||||||
values.put(KEY_VERSION, contact.getVersion());
|
values.put(KEY_VERSION, contact.getVersion());
|
||||||
values.put(KEY_IS_EMPLOYEE, contact.getIsEmployee());
|
values.put(KEY_IS_EMPLOYEE, contact.getIsEmployee());
|
||||||
|
values.put(KEY_PHONENUMBER, contact.getPhoneNumber());
|
||||||
|
|
||||||
writableDatabase.insertOrThrow(TABLE_CONTACTS, null, values);
|
writableDatabase.insertOrThrow(TABLE_CONTACTS, null, values);
|
||||||
}
|
}
|
||||||
@@ -505,8 +509,9 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
String teamMemberNames = cursor.getString(5);
|
String teamMemberNames = cursor.getString(5);
|
||||||
int contactVersion = cursor.getInt(6);
|
int contactVersion = cursor.getInt(6);
|
||||||
boolean isEmployee = cursor.getInt(7) == 1;
|
boolean isEmployee = cursor.getInt(7) == 1;
|
||||||
|
String phoneNumber = cursor.getString(8);
|
||||||
|
|
||||||
ContactListItem contact = new ContactListItem(contactId, contactName, contactPersonOid, contactIsTeam, teamMemberOids, teamMemberNames, contactVersion, isEmployee);
|
ContactListItem contact = new ContactListItem(contactId, contactName, contactPersonOid, contactIsTeam, teamMemberOids, teamMemberNames, contactVersion, isEmployee, phoneNumber);
|
||||||
|
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
|
||||||
@@ -535,6 +540,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
contact.teamMemberOids = cursor.getString(5);
|
contact.teamMemberOids = cursor.getString(5);
|
||||||
contact.setVersion(cursor.getInt(6));
|
contact.setVersion(cursor.getInt(6));
|
||||||
contact.setIsEmployee(cursor.getInt(7) == 1);
|
contact.setIsEmployee(cursor.getInt(7) == 1);
|
||||||
|
contact.setPhoneNumber(cursor.getString(8));
|
||||||
|
|
||||||
contactList.add(contact);
|
contactList.add(contact);
|
||||||
} while (cursor.moveToNext());
|
} while (cursor.moveToNext());
|
||||||
@@ -593,6 +599,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
values.put(KEY_TEAM_MEMBER_OIDS, contact.teamMemberOids);
|
values.put(KEY_TEAM_MEMBER_OIDS, contact.teamMemberOids);
|
||||||
values.put(KEY_VERSION, contact.getVersion());
|
values.put(KEY_VERSION, contact.getVersion());
|
||||||
values.put(KEY_IS_EMPLOYEE, contact.getIsEmployee());
|
values.put(KEY_IS_EMPLOYEE, contact.getIsEmployee());
|
||||||
|
values.put(KEY_PHONENUMBER, contact.getPhoneNumber());
|
||||||
|
|
||||||
return writableDatabase.update(TABLE_CONTACTS, values, KEY_ID + " = ?", new String[] { String.valueOf(contact.getId()) });
|
return writableDatabase.update(TABLE_CONTACTS, values, KEY_ID + " = ?", new String[] { String.valueOf(contact.getId()) });
|
||||||
}
|
}
|
||||||
@@ -637,8 +644,9 @@ public class DatabaseHandler extends SQLiteOpenHelper {
|
|||||||
String teamMemberNames = cursor.getString(5);
|
String teamMemberNames = cursor.getString(5);
|
||||||
int contactVersion = cursor.getInt(6);
|
int contactVersion = cursor.getInt(6);
|
||||||
boolean isEmployee = cursor.getInt(7) == 1;
|
boolean isEmployee = cursor.getInt(7) == 1;
|
||||||
|
String phoneNumber = cursor.getString(8);
|
||||||
|
|
||||||
ContactListItem contact = new ContactListItem(contactId, contactName, contactPersonOid, contactIsTeam, teamMemberOids, teamMemberNames, contactVersion, isEmployee);
|
ContactListItem contact = new ContactListItem(contactId, contactName, contactPersonOid, contactIsTeam, teamMemberOids, teamMemberNames, contactVersion, isEmployee, phoneNumber);
|
||||||
|
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
|
||||||
|
|||||||
@@ -18,11 +18,9 @@ import org.ksoap2.serialization.PropertyInfo;
|
|||||||
import org.ksoap2.serialization.SoapPrimitive;
|
import org.ksoap2.serialization.SoapPrimitive;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
@@ -71,7 +69,7 @@ public class BeWoChatApplication extends Application {
|
|||||||
|
|
||||||
public static Date lastOnlineTS;
|
public static Date lastOnlineTS;
|
||||||
|
|
||||||
private static int refreshIntervalInMinutes = 6;
|
private static int refreshIntervalInMinutes = 2;
|
||||||
public static int getRefreshIntervalInMilliseconds() {
|
public static int getRefreshIntervalInMilliseconds() {
|
||||||
return refreshIntervalInMinutes * 60 * 1000;
|
return refreshIntervalInMinutes * 60 * 1000;
|
||||||
}
|
}
|
||||||
@@ -96,7 +94,7 @@ public class BeWoChatApplication extends Application {
|
|||||||
|
|
||||||
spiceManager.start(this);
|
spiceManager.start(this);
|
||||||
|
|
||||||
keepAlive();
|
keepAliveSOAP();
|
||||||
keepAliveTCP();
|
keepAliveTCP();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +102,8 @@ public class BeWoChatApplication extends Application {
|
|||||||
final Runnable blubb = new Runnable() {
|
final Runnable blubb = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
BeWoLog.writeToLogFile("Führe ScheduledFuture von keepAliveTCP aus...");
|
||||||
|
Log.e("KEEP_ALIVE_TCP", "Führe keepAliveTCP aus");
|
||||||
if(ConnectivityReceiver.isConnected()) {
|
if(ConnectivityReceiver.isConnected()) {
|
||||||
Packet packet = new Packet();
|
Packet packet = new Packet();
|
||||||
packet.ChatDataIdentifier = DataIdentifier.KEEP_ALIVE;
|
packet.ChatDataIdentifier = DataIdentifier.KEEP_ALIVE;
|
||||||
@@ -113,6 +113,9 @@ public class BeWoChatApplication extends Application {
|
|||||||
packet.MessageTimeStamp = Calendar.getInstance().getTime();
|
packet.MessageTimeStamp = Calendar.getInstance().getTime();
|
||||||
|
|
||||||
SocketManager.sendMessage(packet);
|
SocketManager.sendMessage(packet);
|
||||||
|
} else {
|
||||||
|
BeWoLog.writeToLogFile("Bin offline (keepAliveTCP)");
|
||||||
|
Log.e("KEEP_ALIVE_TCP", "Bin offline (keepAliveTCP)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -127,20 +130,26 @@ public class BeWoChatApplication extends Application {
|
|||||||
}, 10, TimeUnit.DAYS);
|
}, 10, TimeUnit.DAYS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void keepAlive() {
|
public void keepAliveSOAP() {
|
||||||
final Runnable blubb = new Runnable() {
|
final Runnable blubb = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
BeWoLog.writeToLogFile("Führe ScheduledFuture von keepAliveSOAP des SOAP-Services aus...");
|
||||||
|
Log.e("KEEP_ALIVE_SOAP", "Führe keepAliveSOAP aus");
|
||||||
JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.KEEP_ALIVE, new ArrayList<PropertyInfo>());
|
JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.KEEP_ALIVE, new ArrayList<PropertyInfo>());
|
||||||
|
|
||||||
if(ConnectivityReceiver.isConnected()) {
|
if(ConnectivityReceiver.isConnected()) {
|
||||||
|
Log.e("KEEP_ALIVE_SOAP", "Ist mit dem Internet verbunden.");
|
||||||
if((Calendar.getInstance().getTime().getTime() - BeWoChatApplication.lastOnlineTS.getTime()) < getRefreshIntervalInMilliseconds()) {
|
if((Calendar.getInstance().getTime().getTime() - BeWoChatApplication.lastOnlineTS.getTime()) < getRefreshIntervalInMilliseconds()) {
|
||||||
BeWoLog.writeToLogFile("Schicke KeepAlive zum SOAP-Server. (SOAP-KeepAlive)");
|
Log.e("KEEP_ALIVE_SOAP", "Sende Keep-Alive zum SOAP-Server.");
|
||||||
|
BeWoLog.writeToLogFile("Schicke Keep-Alive zum SOAP-Server. (SOAP-KeepAlive)");
|
||||||
spiceManager.execute(request, new JsonSoapPrimitiveRequestListener());
|
spiceManager.execute(request, new JsonSoapPrimitiveRequestListener());
|
||||||
} else {
|
} else {
|
||||||
|
Log.e("KEEP_ALIVE_SOAP", "Das Intervall von " + BeWoChatApplication.getRefreshIntervalInMinutes() + " Minuten wurde überschritten. Sende kein KeepAlive an den SOAP-Server. (SOAP-KeepAlive)");
|
||||||
BeWoLog.writeToLogFile("Das Intervall von " + BeWoChatApplication.getRefreshIntervalInMinutes() + " Minuten wurde überschritten. Sende kein KeepAlive an den SOAP-Server. (SOAP-KeepAlive)");
|
BeWoLog.writeToLogFile("Das Intervall von " + BeWoChatApplication.getRefreshIntervalInMinutes() + " Minuten wurde überschritten. Sende kein KeepAlive an den SOAP-Server. (SOAP-KeepAlive)");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Log.e("KEEP_ALIVE_SOAP", "Keine Internetkonnektivität vorhanden. Sende kein Keep-Alive an den SOAP-Server.");
|
||||||
BeWoLog.writeToLogFile("Bin offline. Sende kein KeepAlive an den SOAP-Server. (SOAP-KeepAlive)");
|
BeWoLog.writeToLogFile("Bin offline. Sende kein KeepAlive an den SOAP-Server. (SOAP-KeepAlive)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -190,20 +199,20 @@ public class BeWoChatApplication extends Application {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestFailure(SpiceException spiceException) {
|
public void onRequestFailure(SpiceException spiceException) {
|
||||||
Log.e("BEWOAPP", "Fehler beim am Leben erhalten!");
|
Log.e("KEEP_ALIVE_SOAP", "Fehler beim SOAP-Keep-Alive.");
|
||||||
|
|
||||||
BeWoLog.writeToLogFile("Das JSON-Keep-Alives ist fehlgeschlagen (JsonSoapPrimitiveRequestListener->onRequestFailure)");
|
BeWoLog.writeToLogFile("Das SOAP-Keep-Alives ist fehlgeschlagen (JsonSoapPrimitiveRequestListener->onRequestFailure)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestSuccess(SoapPrimitive soapPrimitive) {
|
public void onRequestSuccess(SoapPrimitive soapPrimitive) {
|
||||||
if(soapPrimitive == null) {
|
if(soapPrimitive == null) {
|
||||||
Log.e("BEWOAPP", "Antwort ist null!");
|
Log.e("KEEP_ALIVE_SOAP", "Antwort ist null!");
|
||||||
BeWoLog.writeToLogFile("Das JSON-Keep-Alives lieferte Null zurück. (JsonSoapPrimitiveRequestListener->onRequestSuccess)");
|
BeWoLog.writeToLogFile("Das SOAP-Keep-Alives lieferte Null zurück. (JsonSoapPrimitiveRequestListener->onRequestSuccess)");
|
||||||
} else {
|
} else {
|
||||||
BeWoChatApplication.lastOnlineTS = Calendar.getInstance().getTime();
|
BeWoChatApplication.lastOnlineTS = Calendar.getInstance().getTime();
|
||||||
BeWoLog.writeToLogFile("Erneuere die Verbindung. (JsonSoapPrimitiveRequestListener->onRequestSuccess)");
|
BeWoLog.writeToLogFile("Erneuere die Verbindung. (JsonSoapPrimitiveRequestListener->onRequestSuccess)");
|
||||||
Log.i("BEWOAPP", "Die Antwort des JSON-Keep-Alives hat einen Wert");
|
Log.e("KEEP_ALIVE_SOAP", "Die Antwort des SOAP-Keep-Alives hat einen Wert");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package beyondsoft.bewomitarbeiterapp;
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -13,6 +14,7 @@ import android.graphics.PorterDuff;
|
|||||||
import android.graphics.PorterDuffXfermode;
|
import android.graphics.PorterDuffXfermode;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
@@ -22,6 +24,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
import android.widget.AbsListView;
|
import android.widget.AbsListView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@@ -43,8 +46,8 @@ import org.ksoap2.serialization.PropertyInfo;
|
|||||||
import org.ksoap2.serialization.SoapPrimitive;
|
import org.ksoap2.serialization.SoapPrimitive;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@@ -52,6 +55,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import Database.DatabaseHandler;
|
import Database.DatabaseHandler;
|
||||||
import entities.ChatEntity;
|
import entities.ChatEntity;
|
||||||
@@ -115,6 +119,8 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
|
|
||||||
setContentView(R.layout.chat);
|
setContentView(R.layout.chat);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ActionBar action = getSupportActionBar();
|
ActionBar action = getSupportActionBar();
|
||||||
|
|
||||||
action.setDisplayShowHomeEnabled(false);
|
action.setDisplayShowHomeEnabled(false);
|
||||||
@@ -126,6 +132,8 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
action.setCustomView(mCustomView);
|
action.setCustomView(mCustomView);
|
||||||
action.setDisplayShowCustomEnabled(true);
|
action.setDisplayShowCustomEnabled(true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
databaseHandler = DatabaseHandler.getInstance(this);
|
databaseHandler = DatabaseHandler.getInstance(this);
|
||||||
|
|
||||||
senden = (Button)findViewById(R.id.Sendebutton);
|
senden = (Button)findViewById(R.id.Sendebutton);
|
||||||
@@ -184,6 +192,11 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
teamMemberNames = zielkorb.getString("TeamMemberNames");
|
teamMemberNames = zielkorb.getString("TeamMemberNames");
|
||||||
isEmployee = zielkorb.getBoolean("IsEmployee");
|
isEmployee = zielkorb.getBoolean("IsEmployee");
|
||||||
|
|
||||||
|
ImageView phoneCallSymbol = (ImageView) mCustomView.findViewById(R.id.phoneCallImageView);
|
||||||
|
if(isTeam) {
|
||||||
|
phoneCallSymbol.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
Log.i("EXTRAS_KONTROLLE", "Empfänger: " + recipientName + "; " + recipientPersonOid);
|
Log.i("EXTRAS_KONTROLLE", "Empfänger: " + recipientName + "; " + recipientPersonOid);
|
||||||
|
|
||||||
ReloadChatView(recipientName, recipientPersonOid, image, isTeam, teamMemberOids, teamMemberNames, isEmployee);
|
ReloadChatView(recipientName, recipientPersonOid, image, isTeam, teamMemberOids, teamMemberNames, isEmployee);
|
||||||
@@ -195,7 +208,6 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
recipientPersonOid = recipientOid;
|
recipientPersonOid = recipientOid;
|
||||||
recipientName = contactName;
|
recipientName = contactName;
|
||||||
isTeam = pIsTeam;
|
isTeam = pIsTeam;
|
||||||
Log.i("CHAT", "IsTeam: " + isTeam);
|
|
||||||
teamMemberOids = pTeamMemberOids;
|
teamMemberOids = pTeamMemberOids;
|
||||||
teamMemberNames = pTeamMemberNames;
|
teamMemberNames = pTeamMemberNames;
|
||||||
isEmployee = pIsEmployee;
|
isEmployee = pIsEmployee;
|
||||||
@@ -204,6 +216,30 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
TextView titlename = (TextView) mCustomView.findViewById(R.id.PersonalName);
|
TextView titlename = (TextView) mCustomView.findViewById(R.id.PersonalName);
|
||||||
RoundImageView titlepic = (RoundImageView) mCustomView.findViewById(R.id.PersonalPic);
|
RoundImageView titlepic = (RoundImageView) mCustomView.findViewById(R.id.PersonalPic);
|
||||||
|
|
||||||
|
boolean hasImage = databaseHandler.isImageExistingForPerson(recipientPersonOid);
|
||||||
|
if(hasImage && !isTeam) {
|
||||||
|
image = databaseHandler.getUserImage(recipientPersonOid);
|
||||||
|
Bitmap img = BitmapFactory.decodeByteArray(image, 0, image.length);
|
||||||
|
titlepic.setImageBitmap(img);
|
||||||
|
} else {
|
||||||
|
int bildId = R.drawable.mitarbeiter_avatar;
|
||||||
|
|
||||||
|
if(isTeam) {
|
||||||
|
bildId = R.drawable.mitarbeiter_team_avatar;
|
||||||
|
} else if(!isEmployee) {
|
||||||
|
bildId = R.drawable.klient_avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bitmap bitmap = KontaktAdapter.decodeSampledBitmapFromResource(this.getResources(), bildId, 100, 100);
|
||||||
|
|
||||||
|
titlepic.setImageBitmap(bitmap);
|
||||||
|
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
|
||||||
|
image = stream.toByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!isTeam) {
|
if(!isTeam) {
|
||||||
status.setImageResource((SocketManager.onlinePersonOids.contains(recipientPersonOid) ? R.drawable.statusonline : R.drawable.statusoffline));
|
status.setImageResource((SocketManager.onlinePersonOids.contains(recipientPersonOid) ? R.drawable.statusonline : R.drawable.statusoffline));
|
||||||
}
|
}
|
||||||
@@ -220,7 +256,7 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
chatMessages = isTeam ? databaseHandler.getMessagesForTeam(recipientPersonOid) : databaseHandler.getMessagesForRecipient(recipientPersonOid);
|
chatMessages = isTeam ? databaseHandler.getMessagesForTeam(recipientPersonOid) : databaseHandler.getMessagesForRecipient(recipientPersonOid);
|
||||||
|
|
||||||
for(ChatMessage cm : chatMessages) {
|
for(ChatMessage cm : chatMessages) {
|
||||||
Log.i("NACHRICHTEN", "" + cm.ChatText + "; MessageId: " + cm.MessageId);
|
Log.i("NACHRICHTEN", "Nachricht aus der Handy-DB: " + cm.ChatText + "; MessageId: " + cm.MessageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = new MessageAdapter(this, R.layout.item_chat_left, chatMessages);
|
adapter = new MessageAdapter(this, R.layout.item_chat_left, chatMessages);
|
||||||
@@ -405,8 +441,6 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
SocketManager.loginCallbackAfterConnectionLost = new Callback() {
|
SocketManager.loginCallbackAfterConnectionLost = new Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void doCallback() {
|
public void doCallback() {
|
||||||
//ReloadChatView(contactName, recipientOid, contactImage, isTeam, teamMemberOids, teamMemberNames, isEmployee);
|
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -414,7 +448,6 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -425,6 +458,7 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
// TODO: nur zur Konversation gehörende MessageIds laden
|
// TODO: nur zur Konversation gehörende MessageIds laden
|
||||||
ArrayList<String> test = isTeam ? databaseHandler.getExistingTeamChatMessageUUIDs(recipientPersonOid, SoapConnectionManager.getUser().getPersonOid().intValue()) : databaseHandler.getExistingChatMessageUUIDs(recipientPersonOid, SoapConnectionManager.getUser().getPersonOid().intValue());
|
ArrayList<String> test = isTeam ? databaseHandler.getExistingTeamChatMessageUUIDs(recipientPersonOid, SoapConnectionManager.getUser().getPersonOid().intValue()) : databaseHandler.getExistingChatMessageUUIDs(recipientPersonOid, SoapConnectionManager.getUser().getPersonOid().intValue());
|
||||||
|
|
||||||
|
Log.i("EXISTING_MESSAGEIDS", "MessageIds der Nachrichten aus der Handy-DB");
|
||||||
String pExceptions = "";
|
String pExceptions = "";
|
||||||
for(int i = 0; i < test.size(); i++) {
|
for(int i = 0; i < test.size(); i++) {
|
||||||
Log.i("EXISTING_MESSAGEIDS", test.get(i));
|
Log.i("EXISTING_MESSAGEIDS", test.get(i));
|
||||||
@@ -453,6 +487,7 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
propertyInfos2.add(SoapConnectionManager.BuildProperty("pSenderPersonOid", SoapConnectionManager.getUser().getPersonOid(), Long.class));
|
propertyInfos2.add(SoapConnectionManager.BuildProperty("pSenderPersonOid", SoapConnectionManager.getUser().getPersonOid(), Long.class));
|
||||||
propertyInfos2.add(SoapConnectionManager.BuildProperty("pIsForTeam", isTeam, Boolean.class));
|
propertyInfos2.add(SoapConnectionManager.BuildProperty("pIsForTeam", isTeam, Boolean.class));
|
||||||
propertyInfos2.add(SoapConnectionManager.BuildProperty("pExceptions", pExceptions, String.class));
|
propertyInfos2.add(SoapConnectionManager.BuildProperty("pExceptions", pExceptions, String.class));
|
||||||
|
propertyInfos2.add(SoapConnectionManager.BuildProperty("pIsInitialCall", isInitialCall, Boolean.class));
|
||||||
|
|
||||||
final JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.LOAD_CHATMESSAGES_CHUNKWISE, propertyInfos2);
|
final JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.LOAD_CHATMESSAGES_CHUNKWISE, propertyInfos2);
|
||||||
|
|
||||||
@@ -542,9 +577,8 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_doku:
|
case R.id.action_doku:
|
||||||
|
Intent brauser = new Intent(Intent.ACTION_VIEW, Uri.parse(SoapCalls.WEB_DOKU_URL + SoapConnectionManager.getUser().getTenant()));
|
||||||
Intent dokuActivity = new Intent(ChatActivity.this, WebdokuActivity.class);
|
startActivity(brauser);
|
||||||
ChatActivity.this.startActivity(dokuActivity);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
@@ -602,6 +636,46 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showBigImage(View view) {
|
||||||
|
Log.i("SHOW_IMAGE_ALERT", "Klick auf Avatar im Chat");
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
|
|
||||||
|
final AlertDialog dialog = builder.create();
|
||||||
|
|
||||||
|
LayoutInflater inflater = getLayoutInflater();
|
||||||
|
View dialogLayout = inflater.inflate(R.layout.image_alert, null);
|
||||||
|
|
||||||
|
Bitmap bitmap = BitmapFactory.decodeByteArray(image, 0, image.length);
|
||||||
|
|
||||||
|
ImageView image = (ImageView) dialogLayout.findViewById(R.id.fullimage);
|
||||||
|
image.setImageBitmap(bitmap);
|
||||||
|
|
||||||
|
dialog.setView(dialogLayout);
|
||||||
|
|
||||||
|
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void makePhoneCall(View view) {
|
||||||
|
ContactListItem cli = databaseHandler.getContactByPersonOid(recipientPersonOid, false);
|
||||||
|
String phoneNumber = cli.getPhoneNumber();
|
||||||
|
|
||||||
|
String pattern = "^([0-9\\+/\\(\\)\\s\\-]*)";
|
||||||
|
|
||||||
|
if(phoneNumber != null && phoneNumber.length() > 0 && Pattern.matches(pattern, phoneNumber)) {
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + cli.getPhoneNumber()));
|
||||||
|
|
||||||
|
ChatActivity.this.startActivity(intent);
|
||||||
|
} catch(Exception exception) {
|
||||||
|
Toast.makeText(ChatActivity.this, "Die Mobilnummer ist ungültig", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Util.buildAlert(ChatActivity.this, "Es wurde keine Mobilnummer für " + recipientName + " hinterlegt oder sie ist ungültig. Bitte tragen Sie diese im BeWoPlaner ein.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private final class JsonSoapPrimitiveRequestListener implements RequestListener<SoapPrimitive> {
|
private final class JsonSoapPrimitiveRequestListener implements RequestListener<SoapPrimitive> {
|
||||||
|
|
||||||
Callback corruptedRequestCallback;
|
Callback corruptedRequestCallback;
|
||||||
@@ -693,15 +767,6 @@ public class ChatActivity extends ActionBarActivity implements ConnectivityRecei
|
|||||||
public void run() {
|
public void run() {
|
||||||
chatMessages.addAll(result);
|
chatMessages.addAll(result);
|
||||||
adapter.sort(DATE_COMPARATOR);
|
adapter.sort(DATE_COMPARATOR);
|
||||||
|
|
||||||
// if(!isInitialCall) {
|
|
||||||
// try {
|
|
||||||
// listView.setSelection(0);
|
|
||||||
// } catch(Exception e) {
|
|
||||||
// Util.buildAlert(ChatActivity.this, "adapter.getCount() hat nicht funktioniert!");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -19,10 +19,11 @@ public class ContactListItem {
|
|||||||
|
|
||||||
private String messagePreview;
|
private String messagePreview;
|
||||||
private boolean isNewMessage2Preview;
|
private boolean isNewMessage2Preview;
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
public ContactListItem(){}
|
public ContactListItem(){}
|
||||||
|
|
||||||
public ContactListItem(int id, String kontaktname, int personOid, boolean isTeam, String teamMemberOids, String teamMemberNames, int version, boolean isEmployee){
|
public ContactListItem(int id, String kontaktname, int personOid, boolean isTeam, String teamMemberOids, String teamMemberNames, int version, boolean isEmployee, String phoneNumber){
|
||||||
this.mId = id;
|
this.mId = id;
|
||||||
this.mChatName = kontaktname;
|
this.mChatName = kontaktname;
|
||||||
this.mPersonOid = personOid;
|
this.mPersonOid = personOid;
|
||||||
@@ -31,9 +32,10 @@ public class ContactListItem {
|
|||||||
this.teamMemberOids = teamMemberOids;
|
this.teamMemberOids = teamMemberOids;
|
||||||
this.mVersion = version;
|
this.mVersion = version;
|
||||||
this.mIsEmployee = isEmployee;
|
this.mIsEmployee = isEmployee;
|
||||||
|
this.phoneNumber = phoneNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContactListItem(String kontaktname, int personOid, boolean isTeam, String teamMemberOids, String teamMemberNames, int version, boolean isEmployee){
|
ContactListItem(String kontaktname, int personOid, boolean isTeam, String teamMemberOids, String teamMemberNames, int version, boolean isEmployee, String phoneNumber){
|
||||||
this.mChatName = kontaktname;
|
this.mChatName = kontaktname;
|
||||||
this.mPersonOid = personOid;
|
this.mPersonOid = personOid;
|
||||||
|
|
||||||
@@ -42,6 +44,7 @@ public class ContactListItem {
|
|||||||
this.teamMemberOids = teamMemberOids;
|
this.teamMemberOids = teamMemberOids;
|
||||||
this.mVersion = version;
|
this.mVersion = version;
|
||||||
this.mIsEmployee = isEmployee;
|
this.mIsEmployee = isEmployee;
|
||||||
|
this.phoneNumber = phoneNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId(){
|
public int getId(){
|
||||||
@@ -127,4 +130,12 @@ public class ContactListItem {
|
|||||||
public Boolean compareToChatPerson(ChatPerson chatPerson) {
|
public Boolean compareToChatPerson(ChatPerson chatPerson) {
|
||||||
return mPersonOid == chatPerson.Oid && isTeam == chatPerson.IsTeam && mIsEmployee == chatPerson.IsEmployee;
|
return mPersonOid == chatPerson.Oid && isTeam == chatPerson.IsTeam && mIsEmployee == chatPerson.IsEmployee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setPhoneNumber(String phoneNumber) {
|
||||||
|
this.phoneNumber = phoneNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhoneNumber() {
|
||||||
|
return phoneNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,8 +60,6 @@ public class KontaktAdapter extends ArrayAdapter<ContactListItem> {
|
|||||||
messagePreview.setText(currentContact.getMessagePreview());
|
messagePreview.setText(currentContact.getMessagePreview());
|
||||||
messagePreview.setTypeface(messagePreview.getTypeface(), currentContact.getIsNewMessage2Preview() ? 1 : 0);
|
messagePreview.setTypeface(messagePreview.getTypeface(), currentContact.getIsNewMessage2Preview() ? 1 : 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(currentContact.isTeam) {
|
if(currentContact.isTeam) {
|
||||||
minitext.setText(currentContact.teamMemberNames);
|
minitext.setText(currentContact.teamMemberNames);
|
||||||
}
|
}
|
||||||
@@ -92,10 +90,6 @@ public class KontaktAdapter extends ArrayAdapter<ContactListItem> {
|
|||||||
} else {
|
} else {
|
||||||
imageView.setImageBitmap(i);
|
imageView.setImageBitmap(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// getPic = new Thread(new CircleBitmapCreator(i));
|
|
||||||
// getPic.start();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log.i("KONTAKT_ADAPTER", "");
|
Log.i("KONTAKT_ADAPTER", "");
|
||||||
|
|
||||||
@@ -124,42 +118,7 @@ public class KontaktAdapter extends ArrayAdapter<ContactListItem> {
|
|||||||
return rowView;
|
return rowView;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class CircleBitmapCreator implements Runnable{
|
public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, int reqWidth, int reqHeight) {
|
||||||
|
|
||||||
Bitmap bitmap;
|
|
||||||
CircleBitmapCreator(Bitmap _bitmap){
|
|
||||||
this.bitmap = _bitmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run(){
|
|
||||||
final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
|
||||||
final Canvas canvas = new Canvas(output);
|
|
||||||
|
|
||||||
final int color = Color.RED;
|
|
||||||
final Paint paint = new Paint();
|
|
||||||
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
|
||||||
final RectF rectF = new RectF(rect);
|
|
||||||
|
|
||||||
paint.setAntiAlias(true);
|
|
||||||
canvas.drawARGB(0, 0, 0, 0);
|
|
||||||
paint.setColor(color);
|
|
||||||
canvas.drawOval(rectF, paint);
|
|
||||||
|
|
||||||
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
|
||||||
canvas.drawBitmap(bitmap, rect, rect, paint);
|
|
||||||
|
|
||||||
bitmap.recycle();
|
|
||||||
|
|
||||||
imageView.post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
imageView.setImageBitmap(output);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, int reqWidth, int reqHeight) {
|
|
||||||
final BitmapFactory.Options options = new BitmapFactory.Options();
|
final BitmapFactory.Options options = new BitmapFactory.Options();
|
||||||
options.inJustDecodeBounds = true;
|
options.inJustDecodeBounds = true;
|
||||||
BitmapFactory.decodeResource(res, resId, options);
|
BitmapFactory.decodeResource(res, resId, options);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
@@ -65,7 +66,6 @@ import util.Util;
|
|||||||
*/
|
*/
|
||||||
public class KontaktChatActivity extends ActionBarActivity implements ConnectivityReceiver.ConnectivityReceiverListener, SwipeRefreshLayout.OnRefreshListener {
|
public class KontaktChatActivity extends ActionBarActivity implements ConnectivityReceiver.ConnectivityReceiverListener, SwipeRefreshLayout.OnRefreshListener {
|
||||||
private static boolean isDownloadOfContacsInProgress = false;
|
private static boolean isDownloadOfContacsInProgress = false;
|
||||||
private static boolean isDownloadOfNewestMessagesInProgress = false;
|
|
||||||
private static final String LOGTAG = "KONTAKT_CHAT_ACTIVITY";
|
private static final String LOGTAG = "KONTAKT_CHAT_ACTIVITY";
|
||||||
|
|
||||||
private SpiceManager spiceManager = new SpiceManager(UncachedSpiceService.class);
|
private SpiceManager spiceManager = new SpiceManager(UncachedSpiceService.class);
|
||||||
@@ -117,24 +117,9 @@ public class KontaktChatActivity extends ActionBarActivity implements Connectivi
|
|||||||
bundle.putString("TeamMemberNames", selectedValue.teamMemberNames);
|
bundle.putString("TeamMemberNames", selectedValue.teamMemberNames);
|
||||||
bundle.putBoolean("IsEmployee", selectedValue.getIsEmployee());
|
bundle.putBoolean("IsEmployee", selectedValue.getIsEmployee());
|
||||||
|
|
||||||
if(!selectedValue.isTeam && databaseHandler.isImageExistingForPerson(selectedValue.getPersonOid())) {
|
|
||||||
bundle.putByteArray("Image", databaseHandler.getUserImage(selectedValue.getPersonOid()));
|
|
||||||
}
|
|
||||||
|
|
||||||
Intent in = new Intent(getBaseContext(), ChatActivity.class);
|
Intent in = new Intent(getBaseContext(), ChatActivity.class);
|
||||||
in.putExtras(bundle);
|
in.putExtras(bundle);
|
||||||
|
|
||||||
// TODO: durch Datebankaufruf ersetzen
|
|
||||||
// if(selectedValue.getPicture() == null) {
|
|
||||||
// ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
|
||||||
// Bitmap a = BitmapFactory.decodeResource(getResources(), R.drawable.mitarbeiter_avatar);
|
|
||||||
// a.compress(Bitmap.CompressFormat.JPEG,0,stream);
|
|
||||||
// byte[] x = stream.toByteArray();
|
|
||||||
// in.putExtra("Bild", x);
|
|
||||||
// } else {
|
|
||||||
// in.putExtra("Bild", selectedValue.getPicture());
|
|
||||||
// }
|
|
||||||
|
|
||||||
startActivity(in);
|
startActivity(in);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -459,8 +444,8 @@ public class KontaktChatActivity extends ActionBarActivity implements Connectivi
|
|||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.action_kontaktlist_doku:
|
case R.id.action_kontaktlist_doku:
|
||||||
|
|
||||||
Intent dokuActivity = new Intent(KontaktChatActivity.this, WebdokuActivity.class);
|
Intent brauser = new Intent(Intent.ACTION_VIEW, Uri.parse(SoapCalls.WEB_DOKU_URL + SoapConnectionManager.getUser().getTenant()));
|
||||||
KontaktChatActivity.this.startActivity(dokuActivity);
|
startActivity(brauser);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_kontaktlist_logout:
|
case R.id.action_kontaktlist_logout:
|
||||||
@@ -734,7 +719,7 @@ public class KontaktChatActivity extends ActionBarActivity implements Connectivi
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(ChatPerson cp : result) {
|
for(ChatPerson cp : result) {
|
||||||
ContactListItem contact = new ContactListItem(cp.Name, cp.Oid, cp.IsTeam, cp.TeamMemberOids, cp.TeamMemberNames, cp.Version, cp.IsEmployee);
|
ContactListItem contact = new ContactListItem(cp.Name, cp.Oid, cp.IsTeam, cp.TeamMemberOids, cp.TeamMemberNames, cp.Version, cp.IsEmployee, cp.PhoneNumber);
|
||||||
|
|
||||||
ChatEntity cliEntity = new ChatEntity(cp.Oid, cp.IsTeam, cp.IsEmployee);
|
ChatEntity cliEntity = new ChatEntity(cp.Oid, cp.IsTeam, cp.IsEmployee);
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,12 @@ import java.io.IOException;
|
|||||||
import java.security.InvalidAlgorithmParameterException;
|
import java.security.InvalidAlgorithmParameterException;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import javax.crypto.NoSuchPaddingException;
|
import javax.crypto.NoSuchPaddingException;
|
||||||
|
|
||||||
@@ -251,42 +255,50 @@ public class LoginActivity extends ActionBarActivity {
|
|||||||
else {
|
else {
|
||||||
showProgress(true);
|
showProgress(true);
|
||||||
|
|
||||||
RequestQueue queue = Volley.newRequestQueue(LoginActivity.this);
|
if(SoapCalls.isInDevelopingMode) {
|
||||||
String url = SoapCalls.VOUCHER_ADDRESS + token;
|
ArrayList<PropertyInfo> propertyInfos = new ArrayList<>();
|
||||||
|
propertyInfos.add(SoapConnectionManager.BuildProperty("pTenant", tenant, String.class));
|
||||||
|
propertyInfos.add(SoapConnectionManager.BuildProperty("pUsername", username, String.class));
|
||||||
|
propertyInfos.add(SoapConnectionManager.BuildProperty("pPassword", password, String.class));
|
||||||
|
|
||||||
// StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
|
JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.LOGIN_CALL, propertyInfos);
|
||||||
// @Override
|
spiceManager.execute(request, new JsonSoapPrimitiveRequestListener());
|
||||||
// public void onResponse(String response) {
|
} else {
|
||||||
// if(response == null || TextUtils.isEmpty(response)) {
|
RequestQueue queue = Volley.newRequestQueue(LoginActivity.this);
|
||||||
// showProgress(false);
|
String url = SoapCalls.VOUCHER_ADDRESS + token;
|
||||||
//
|
|
||||||
// clearSharedPreferences();
|
|
||||||
//
|
|
||||||
// mChatCodeView.setError(getString(R.string.error_invalid_input));
|
|
||||||
//
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Util.buildAlert(LoginActivity.this, response);
|
|
||||||
|
|
||||||
ArrayList<PropertyInfo> propertyInfos = new ArrayList<>();
|
StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
|
||||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pTenant", tenant, String.class));
|
@Override
|
||||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pUsername", username, String.class));
|
public void onResponse(String response) {
|
||||||
propertyInfos.add(SoapConnectionManager.BuildProperty("pPassword", password, String.class));
|
if(response == null || TextUtils.isEmpty(response)) {
|
||||||
|
showProgress(false);
|
||||||
|
|
||||||
JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.LOGIN_CALL, propertyInfos);
|
clearSharedPreferences();
|
||||||
spiceManager.execute(request, new JsonSoapPrimitiveRequestListener());
|
|
||||||
// }
|
mChatCodeView.setError(getString(R.string.error_invalid_input));
|
||||||
// }, new Response.ErrorListener() {
|
|
||||||
// @Override
|
return;
|
||||||
// public void onErrorResponse(VolleyError error) {
|
}
|
||||||
// showProgress(false);
|
|
||||||
//
|
ArrayList<PropertyInfo> propertyInfos = new ArrayList<>();
|
||||||
// Log.e("Error sending request", (error == null ? "error is null" : error.getMessage()));
|
propertyInfos.add(SoapConnectionManager.BuildProperty("pTenant", tenant, String.class));
|
||||||
// }
|
propertyInfos.add(SoapConnectionManager.BuildProperty("pUsername", username, String.class));
|
||||||
// });
|
propertyInfos.add(SoapConnectionManager.BuildProperty("pPassword", password, String.class));
|
||||||
//
|
|
||||||
// queue.add(stringRequest);
|
JsonSoapPrimitiveRequest request = new JsonSoapPrimitiveRequest(SoapCalls.LOGIN_CALL, propertyInfos);
|
||||||
|
spiceManager.execute(request, new JsonSoapPrimitiveRequestListener());
|
||||||
|
}
|
||||||
|
}, new Response.ErrorListener() {
|
||||||
|
@Override
|
||||||
|
public void onErrorResponse(VolleyError error) {
|
||||||
|
showProgress(false);
|
||||||
|
|
||||||
|
Log.e("Error sending request", (error == null ? "error is null" : error.getMessage()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
queue.add(stringRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,6 +356,13 @@ public class LoginActivity extends ActionBarActivity {
|
|||||||
Log.i("LOGIN", abc);
|
Log.i("LOGIN", abc);
|
||||||
|
|
||||||
if(abc.contains(";")) {
|
if(abc.contains(";")) {
|
||||||
|
Date currentDate = Calendar.getInstance().getTime();
|
||||||
|
DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss_SSS", Locale.GERMAN);
|
||||||
|
|
||||||
|
String dateString = dateFormat.format(currentDate);
|
||||||
|
|
||||||
|
BeWoLog.LOGFILENAME = "BeWoLog" + dateString + ".txt";
|
||||||
|
|
||||||
BeWoLog.writeToLogFile("Der User ist angemeldet (LoginActivity->JsonSoapPrimitiveRequestListener->onRequestSuccess)");
|
BeWoLog.writeToLogFile("Der User ist angemeldet (LoginActivity->JsonSoapPrimitiveRequestListener->onRequestSuccess)");
|
||||||
|
|
||||||
String[] blubb = abc.split(";");
|
String[] blubb = abc.split(";");
|
||||||
@@ -404,6 +423,8 @@ public class LoginActivity extends ActionBarActivity {
|
|||||||
public void doCallback() {
|
public void doCallback() {
|
||||||
Log.e("LOGIN_CALLBACK", "LoginCallback aufgerufen. Ist verbunden und ruft die ChatActivity nun auf.");
|
Log.e("LOGIN_CALLBACK", "LoginCallback aufgerufen. Ist verbunden und ruft die ChatActivity nun auf.");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BeWoLog.writeToLogFile("Rufe die KontaktChatActivity auf (LoginActivity->JsonSoapPrimitiveRequestListener->onRequestSuccess)");
|
BeWoLog.writeToLogFile("Rufe die KontaktChatActivity auf (LoginActivity->JsonSoapPrimitiveRequestListener->onRequestSuccess)");
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|||||||
@@ -11,14 +11,16 @@ public class ChatPerson {
|
|||||||
public String TeamMemberOids;
|
public String TeamMemberOids;
|
||||||
public int Version;
|
public int Version;
|
||||||
public boolean IsEmployee;
|
public boolean IsEmployee;
|
||||||
|
public String PhoneNumber;
|
||||||
|
|
||||||
public ChatPerson(int oid, String name, boolean isTeam, String teamMemberNames, String teamMemberOids, int version, boolean isEmployee) {
|
public ChatPerson(int oid, String name, boolean isTeam, String teamMemberNames, String teamMemberOids, int version, boolean isEmployee, String phoneNumber) {
|
||||||
Oid = oid;
|
Oid = oid;
|
||||||
Name = name;
|
Name = name;
|
||||||
IsTeam = isTeam;
|
IsTeam = isTeam;
|
||||||
TeamMemberNames = teamMemberNames;
|
TeamMemberNames = teamMemberNames;
|
||||||
TeamMemberOids = teamMemberOids;
|
TeamMemberOids = teamMemberOids;
|
||||||
Version = version;
|
Version = version;
|
||||||
IsEmployee = isEmployee;
|
IsEmployee = isEmployee;
|
||||||
|
PhoneNumber = phoneNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,24 +19,24 @@ public class SoapCalls {
|
|||||||
public static String LOAD_USER_IMAGES = "LoadUserImages";
|
public static String LOAD_USER_IMAGES = "LoadUserImages";
|
||||||
|
|
||||||
//TODO: "app4.bewoplaner.de";//
|
//TODO: "app4.bewoplaner.de";//
|
||||||
// public static String DESTINATION_ADDRESS = "app4.bewoplaner.de";
|
public static String DESTINATION_ADDRESS = "app4.bewoplaner.de";
|
||||||
// public static int DESTINATION_PORT = 5000;
|
|
||||||
//
|
|
||||||
// public static String TOKEN_CHECK_URL = "https://" + DESTINATION_ADDRESS + "/mobil/main/checktoken?token=";
|
|
||||||
//
|
|
||||||
// public static String WEB_DOKU_URL = "https://app1.bewoplaner.de/mobil/login/1234567890";
|
|
||||||
//
|
|
||||||
// public static String WSDL_TARGET_NAME = "bliblablubb.org/";
|
|
||||||
// public static String SOAP_ADDRESS = "https://" + DESTINATION_ADDRESS + "/BeWoPlanerAndroid/AndroidSoapService.asmx";
|
|
||||||
|
|
||||||
|
|
||||||
public static String DESTINATION_ADDRESS = "192.168.1.103";
|
|
||||||
public static int DESTINATION_PORT = 5000;
|
public static int DESTINATION_PORT = 5000;
|
||||||
|
|
||||||
public static String TOKEN_CHECK_URL = "http://" + DESTINATION_ADDRESS + "/bewoplanermobil/main/checktoken?token=";
|
// public static String WEB_DOKU_URL = "https://app1.bewoplaner.de/mobil/login/1234567890";
|
||||||
|
public static String WEB_DOKU_URL = "https://" + DESTINATION_ADDRESS + "/mobil/login/";
|
||||||
|
|
||||||
public static String WEB_DOKU_URL = "http://" + DESTINATION_ADDRESS + "/bewoplanermobil/login/demo";
|
public static String WSDL_TARGET_NAME = "bliblablubb.org/";
|
||||||
|
public static String SOAP_ADDRESS = "https://" + DESTINATION_ADDRESS + "/BeWoPlanerAndroid/AndroidSoapService.asmx";
|
||||||
|
|
||||||
static String WSDL_TARGET_NAME = "bliblablubb.org/";
|
|
||||||
static String SOAP_ADDRESS = "http://" + DESTINATION_ADDRESS + "/BeWoPlanerAndroid/AndroidSoapService.asmx";
|
public static boolean isInDevelopingMode = false;
|
||||||
|
|
||||||
|
|
||||||
|
// public static String DESTINATION_ADDRESS = "192.168.1.103";
|
||||||
|
// public static int DESTINATION_PORT = 5000;
|
||||||
|
//
|
||||||
|
// public static String WEB_DOKU_URL = "http://" + DESTINATION_ADDRESS + "/bewoplanermobil/login/demo";
|
||||||
|
//
|
||||||
|
// static String WSDL_TARGET_NAME = "bliblablubb.org/";
|
||||||
|
// static String SOAP_ADDRESS = "http://" + DESTINATION_ADDRESS + "/BeWoPlanerAndroid/AndroidSoapService.asmx";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ public class SocketManager {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SocketManager.connectToServer("MessageSender. Socket und/oder OutputStream sind null");
|
SocketManager.connectToServer("MessageSender. Socket und/oder OutputStream sind null.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BeWoLog.writeToLogFile("Letzer Serverkontakt ist länger als " + BeWoChatApplication.getRefreshIntervalInMilliseconds() + " Minuten. (MessageSender)");
|
BeWoLog.writeToLogFile("Letzer Serverkontakt ist länger als " + BeWoChatApplication.getRefreshIntervalInMilliseconds() + " Minuten. (MessageSender)");
|
||||||
@@ -269,8 +269,6 @@ public class SocketManager {
|
|||||||
|
|
||||||
private static class SocketListener implements Runnable {
|
private static class SocketListener implements Runnable {
|
||||||
|
|
||||||
Packet chatPacket;
|
|
||||||
|
|
||||||
private volatile boolean isRunning = true;
|
private volatile boolean isRunning = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -328,7 +326,7 @@ public class SocketManager {
|
|||||||
|
|
||||||
switch (chatPacket.ChatDataIdentifier) {
|
switch (chatPacket.ChatDataIdentifier) {
|
||||||
case KEEP_ALIVE:
|
case KEEP_ALIVE:
|
||||||
|
Log.e("KEEP_ALIVE_TCP", "TCP-Keep-Alive-Antwort erhalten.");
|
||||||
BeWoLog.writeToLogFile("KeepAlive-Antwort erhalten. (SocketManger)");
|
BeWoLog.writeToLogFile("KeepAlive-Antwort erhalten. (SocketManger)");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import java.util.Locale;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class BeWoLog {
|
public class BeWoLog {
|
||||||
|
public static String LOGFILENAME = "BeWoLog.txt";
|
||||||
|
|
||||||
public static void writeToLogFile(String data) {
|
public static void writeToLogFile(String data) {
|
||||||
if(!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
|
if(!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
|
||||||
Log.e("BEWOLOG", "Kein externes Speichermedium vorhanden.");
|
Log.e("BEWOLOG", "Kein externes Speichermedium vorhanden.");
|
||||||
@@ -34,7 +36,7 @@ public class BeWoLog {
|
|||||||
File dir = new File(root.getAbsolutePath() + "/" + Util.LOGFILEDIRECTORYNAME);
|
File dir = new File(root.getAbsolutePath() + "/" + Util.LOGFILEDIRECTORYNAME);
|
||||||
dir.mkdirs();
|
dir.mkdirs();
|
||||||
|
|
||||||
File file = new File(dir, Util.LOGFILENAME);
|
File file = new File(dir, LOGFILENAME);
|
||||||
try {
|
try {
|
||||||
FileOutputStream fileOutputStream = new FileOutputStream(file, true);
|
FileOutputStream fileOutputStream = new FileOutputStream(file, true);
|
||||||
PrintWriter printWriter = new PrintWriter(fileOutputStream);
|
PrintWriter printWriter = new PrintWriter(fileOutputStream);
|
||||||
@@ -56,7 +58,7 @@ public class BeWoLog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
File root = android.os.Environment.getExternalStorageDirectory();
|
File root = android.os.Environment.getExternalStorageDirectory();
|
||||||
File logFile = new File(root.getAbsolutePath() + "/" + Util.LOGFILEDIRECTORYNAME + "/" + Util.LOGFILENAME);
|
File logFile = new File(root.getAbsolutePath() + "/" + Util.LOGFILEDIRECTORYNAME + "/" + LOGFILENAME);
|
||||||
|
|
||||||
return logFile.delete();
|
return logFile.delete();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,16 @@ public class ChatPersonDeserializer implements JsonDeserializer<ChatPerson> {
|
|||||||
boolean isTeam = json.get("IsTeam").getAsBoolean();
|
boolean isTeam = json.get("IsTeam").getAsBoolean();
|
||||||
|
|
||||||
boolean isTeamMemberNamesNull = json.get("TeamMemberNames").isJsonNull();
|
boolean isTeamMemberNamesNull = json.get("TeamMemberNames").isJsonNull();
|
||||||
boolean isTeamMemberOidsNull = json.get("TeamMemberOids").isJsonNull();
|
boolean isTeamMemberOidsNull = json.get("TeamMemberOids").isJsonNull();
|
||||||
|
|
||||||
String teamMemberNames = isTeamMemberNamesNull ? null : json.get("TeamMemberNames").getAsString(); // könnte NULL sein
|
String teamMemberNames = isTeamMemberNamesNull ? null : json.get("TeamMemberNames").getAsString(); // könnte NULL sein
|
||||||
String teamMemberOids = isTeamMemberOidsNull ? null : json.get("TeamMemberOids").getAsString(); // könnte NULL sein
|
String teamMemberOids = isTeamMemberOidsNull ? null : json.get("TeamMemberOids").getAsString(); // könnte NULL sein
|
||||||
int version = Long.valueOf(json.get("Version").getAsLong()).intValue();
|
int version = Long.valueOf(json.get("Version").getAsLong()).intValue();
|
||||||
boolean isEmployee = json.get("IsEmployee").getAsBoolean();
|
boolean isEmployee = json.get("IsEmployee").getAsBoolean();
|
||||||
|
|
||||||
return new ChatPerson(oid, name, isTeam, teamMemberNames, teamMemberOids, version, isEmployee);
|
boolean isPhoneNumberNull = json.get("PhoneNumber").isJsonNull();
|
||||||
|
String phoneNumber = isPhoneNumberNull ? null : json.get("PhoneNumber").getAsString();
|
||||||
|
|
||||||
|
return new ChatPerson(oid, name, isTeam, teamMemberNames, teamMemberOids, version, isEmployee, phoneNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ public class Util {
|
|||||||
|
|
||||||
static final String NOTIFICATION_CANCELLED = "notification_cancelled";
|
static final String NOTIFICATION_CANCELLED = "notification_cancelled";
|
||||||
|
|
||||||
static String LOGFILENAME = "BeWoLog.txt";
|
|
||||||
static String LOGFILEDIRECTORYNAME = "BeWo";
|
static String LOGFILEDIRECTORYNAME = "BeWo";
|
||||||
|
|
||||||
static int conversationsCount = 0;
|
static int conversationsCount = 0;
|
||||||
|
|||||||
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 491 B |
|
After Width: | Height: | Size: 491 B |
|
After Width: | Height: | Size: 491 B |
@@ -1,9 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="45dp"
|
android:background="@color/beyondsoft_orange"
|
||||||
>
|
android:layout_height="45dp">
|
||||||
|
|
||||||
|
|
||||||
<beyondsoft.bewomitarbeiterapp.RoundImageView
|
<beyondsoft.bewomitarbeiterapp.RoundImageView
|
||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
@@ -13,6 +12,7 @@
|
|||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
|
android:onClick="showBigImage"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
@@ -26,16 +26,30 @@
|
|||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:id="@+id/status"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="20dp"
|
android:layout_height="match_parent"
|
||||||
android:src="@drawable/statusoffline"
|
android:orientation="horizontal"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_gravity="center_vertical" />
|
android:layout_gravity="center_vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:src="@drawable/ic_call_white_18dp"
|
||||||
|
android:onClick="makePhoneCall"
|
||||||
|
android:id="@+id/phoneCallImageView"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- Merke: Das Design muss noch angepasst werden, da der Text über dem Bild liegt. /
|
<ImageView
|
||||||
Vorläufig gelöst mit margin. Dies kann aber nicht die endgültige Lösung sein. -->
|
android:id="@+id/status"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:src="@drawable/statusoffline"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/layout_root"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:padding="0dp">
|
||||||
|
|
||||||
|
<ImageView android:id="@+id/fullimage"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:adjustViewBounds="true">
|
||||||
|
</ImageView>
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/white">
|
android:background="@color/white">
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -12,9 +12,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/bwp_logo"
|
android:src="@drawable/bwp_logo"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="50dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="50dp"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="80dp"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:contentDescription="@string/bwp_logo_description"/>
|
android:contentDescription="@string/bwp_logo_description"/>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
||||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
org.gradle.jvmargs=-Xmx2048m
|
org.gradle.jvmargs=-Xmx3072m
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ namespace BeWoChatServer
|
|||||||
|
|
||||||
var dataPacket = (Packet) asyncResult.AsyncState;
|
var dataPacket = (Packet) asyncResult.AsyncState;
|
||||||
|
|
||||||
Console.WriteLine(DateTime.Now + ": Empfange Nachricht");
|
Console.WriteLine(DateTime.Now + ": Empfange Nachricht (" + dataPacket.DataIdentifier.ToString() + ")");
|
||||||
|
|
||||||
LogAllClients();
|
LogAllClients();
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ namespace BeWoChatServer
|
|||||||
DAOFactory.GenericDAO.Insert(chatMessage);
|
DAOFactory.GenericDAO.Insert(chatMessage);
|
||||||
|
|
||||||
var newestMessage = DAOFactory.SearchDAO.GetNewestChatMessageForConversation(dataPacket.RecipientPersonOid, dataPacket.SenderPersonOid, false);
|
var newestMessage = DAOFactory.SearchDAO.GetNewestChatMessageForConversation(dataPacket.RecipientPersonOid, dataPacket.SenderPersonOid, false);
|
||||||
var newestChatMessage = new NewestChatMessage()
|
var newestChatMessage = new NewestChatMessage
|
||||||
{
|
{
|
||||||
ChatMessageOid = chatMessage.Oid,
|
ChatMessageOid = chatMessage.Oid,
|
||||||
IsTeam = false,
|
IsTeam = false,
|
||||||
@@ -437,7 +437,7 @@ namespace BeWoChatServer
|
|||||||
DAOFactory.GenericDAO.Insert(chatMessage);
|
DAOFactory.GenericDAO.Insert(chatMessage);
|
||||||
|
|
||||||
var newestMessage = DAOFactory.SearchDAO.GetNewestChatMessageForConversation(dataPacket.RecipientPersonOid, dataPacket.SenderPersonOid, true);
|
var newestMessage = DAOFactory.SearchDAO.GetNewestChatMessageForConversation(dataPacket.RecipientPersonOid, dataPacket.SenderPersonOid, true);
|
||||||
var newestChatMessage = new NewestChatMessage()
|
var newestChatMessage = new NewestChatMessage
|
||||||
{
|
{
|
||||||
ChatMessageOid = chatMessage.Oid,
|
ChatMessageOid = chatMessage.Oid,
|
||||||
IsTeam = true,
|
IsTeam = true,
|
||||||
@@ -604,6 +604,14 @@ namespace BeWoChatServer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Random random = new Random();
|
||||||
|
public static string RandomString(int length)
|
||||||
|
{
|
||||||
|
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
|
return new string(Enumerable.Repeat(chars, length)
|
||||||
|
.Select(s => s[random.Next(s.Length)]).ToArray());
|
||||||
|
}
|
||||||
|
|
||||||
private static void SendNotificationPacket(Packet dataPacket, DataIdentifier dataIdentifier)
|
private static void SendNotificationPacket(Packet dataPacket, DataIdentifier dataIdentifier)
|
||||||
{
|
{
|
||||||
var notificationPacket = new Packet(dataPacket.Socket, dataPacket.ClientName, dataPacket.SenderPersonOid, 0, dataPacket.IsEmployee) { DataIdentifier = DataIdentifier.StatusNotificationLogout, Tenant = dataPacket.Tenant};
|
var notificationPacket = new Packet(dataPacket.Socket, dataPacket.ClientName, dataPacket.SenderPersonOid, 0, dataPacket.IsEmployee) { DataIdentifier = DataIdentifier.StatusNotificationLogout, Tenant = dataPacket.Tenant};
|
||||||
|
|||||||
@@ -36,8 +36,11 @@ namespace BeWoPlanerAndroid
|
|||||||
[WebMethod(EnableSession = true)]
|
[WebMethod(EnableSession = true)]
|
||||||
public string Login(string pTenant, string pUsername, string pPassword)
|
public string Login(string pTenant, string pUsername, string pPassword)
|
||||||
{
|
{
|
||||||
|
Log.Info("Login. Beginne mit Login");
|
||||||
|
|
||||||
if(!SoapHibernateSessionManager.TenantExists(pTenant))
|
if(!SoapHibernateSessionManager.TenantExists(pTenant))
|
||||||
{
|
{
|
||||||
|
Log.Info("Login. Angegebene Kundennummer ist falsch (" + pTenant + ")");
|
||||||
return LoginFailReason.WrongTenant.ToString();
|
return LoginFailReason.WrongTenant.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,31 +48,36 @@ namespace BeWoPlanerAndroid
|
|||||||
Tenant = pTenant;
|
Tenant = pTenant;
|
||||||
|
|
||||||
SoapHibernateSessionManager.ConfigureHibernateSession();
|
SoapHibernateSessionManager.ConfigureHibernateSession();
|
||||||
|
|
||||||
var derTimeout = Session.Timeout;
|
|
||||||
Debug.WriteLine("Timeout der Session: " + derTimeout);
|
|
||||||
|
|
||||||
var s = new UserServiceImp();
|
var s = new UserServiceImp();
|
||||||
|
|
||||||
if(s.IsUserValid(pUsername, pPassword, null, "SOAPClient", false) == UserValidationResult.UserValid)
|
if (s.IsUserValid(pUsername, pPassword, null, "SOAPClient", false) == UserValidationResult.UserValid)
|
||||||
{
|
{
|
||||||
|
Log.Info("Login. Beginne mit Login");
|
||||||
var user = DAOFactory.UserDAO.FindUserByLoginName(pUsername);
|
var user = DAOFactory.UserDAO.FindUserByLoginName(pUsername);
|
||||||
|
|
||||||
if (user == null || !DAOFactory.SearchDAO.CheckIfEmployeeIsAllowedToChat(user.Employee.Person.Oid.Value))
|
if (user == null || !DAOFactory.SearchDAO.CheckIfEmployeeIsAllowedToChat(user.Employee.Person.Oid.Value))
|
||||||
{
|
{
|
||||||
|
Log.Info("Login. Der Benutzer existiert nicht oder er hat nicht das Recht zu chatten. (LoginFailReason.Unauthorized)");
|
||||||
return LoginFailReason.Unauthorized.ToString();
|
return LoginFailReason.Unauthorized.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!DAOFactory.UserDAO.CheckPassword(user, pPassword))
|
if (!DAOFactory.UserDAO.CheckPassword(user, pPassword))
|
||||||
{
|
{
|
||||||
|
Log.Info("Login. Benutzername und/oder Passwort inkorrekt (LoginFailReason.WrongCredentials)");
|
||||||
return LoginFailReason.WrongCredentials.ToString();
|
return LoginFailReason.WrongCredentials.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
MobileSessionFacade.LoggedInUser = user;
|
MobileSessionFacade.LoggedInUser = user;
|
||||||
|
|
||||||
return user.Employee.Oid.Value + ";" + user.Employee.Person.FirstNameLastName + ";" + user.LoginName + ";" + user.Employee.Person.Oid.Value;
|
Log.Info("Login. Der Login war erfolgreich");
|
||||||
|
|
||||||
|
return user.Employee.Oid.Value + ";" + user.Employee.Person.FirstNameLastName + ";" + user.LoginName +
|
||||||
|
";" + user.Employee.Person.Oid.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.Info("Login. Benutzername und/oder Passwort inkorrekt (LoginFailReason.Unknown)");
|
||||||
|
|
||||||
return LoginFailReason.Unknown.ToString();
|
return LoginFailReason.Unknown.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +162,7 @@ namespace BeWoPlanerAndroid
|
|||||||
var allPersons = DAOFactory.SearchDAO.FindAllChatAuthorizedPersonsForEmployee(employee.Oid.Value).Where(w => w.Key.Oid.Value != employee.Person.Oid.Value);
|
var allPersons = DAOFactory.SearchDAO.FindAllChatAuthorizedPersonsForEmployee(employee.Oid.Value).Where(w => w.Key.Oid.Value != employee.Person.Oid.Value);
|
||||||
|
|
||||||
var allChatPersons = allPersons
|
var allChatPersons = allPersons
|
||||||
.Select(s => new ChatPerson(s.Key.Oid.Value, s.Key.FirstNameLastName, false, null, null, s.Key.Version.Value, s.Value)).ToList();
|
.Select(s => new ChatPerson(s.Key.Oid.Value, s.Key.FirstNameLastName, false, null, null, s.Key.Version.Value, s.Value, s.Key.Contacts.FirstOrDefault(f => f.Type == ContactType.business_MobilePhone) == null ? "" : s.Key.Contacts.FirstOrDefault(f => f.Type == ContactType.business_MobilePhone).Value)).ToList();
|
||||||
|
|
||||||
var teams = DAOFactory.SearchDAO.FindTeamsOfEmployee(employee.Oid.Value).Where(w => w.MemberList.Count > 1);
|
var teams = DAOFactory.SearchDAO.FindTeamsOfEmployee(employee.Oid.Value).Where(w => w.MemberList.Count > 1);
|
||||||
|
|
||||||
@@ -177,7 +185,7 @@ namespace BeWoPlanerAndroid
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allChatPersons.Add(new ChatPerson(team.Oid.Value, team.Name, true, memberString, memberNames, team.Version.Value, false));
|
allChatPersons.Add(new ChatPerson(team.Oid.Value, team.Name, true, memberString, memberNames, team.Version.Value, false, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
return SerializeObject(allChatPersons);
|
return SerializeObject(allChatPersons);
|
||||||
@@ -191,6 +199,8 @@ namespace BeWoPlanerAndroid
|
|||||||
[WebMethod(EnableSession = true)]
|
[WebMethod(EnableSession = true)]
|
||||||
public string KeepAlive()
|
public string KeepAlive()
|
||||||
{
|
{
|
||||||
|
Log.Info("KeepAlive auf dem SOAP-Server wird ausgeführt");
|
||||||
|
|
||||||
return "lebt";
|
return "lebt";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,9 +214,13 @@ namespace BeWoPlanerAndroid
|
|||||||
return JsonConvert.SerializeObject(existingMessageIds);
|
return JsonConvert.SerializeObject(existingMessageIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
[WebMethod(EnableSession = true)]
|
[WebMethod(EnableSession = true)]
|
||||||
public string LoadChatMessagesChunkwise(string messageId, long pRecipientPersonOid, long pSenderPersonOid, bool pIsForTeam, string pExceptions)
|
public string LoadChatMessagesChunkwise(string messageId, long pRecipientPersonOid, long pSenderPersonOid, bool pIsForTeam, string pExceptions, bool pIsInitialCall)
|
||||||
{
|
{
|
||||||
|
Log.Info("LoadChatMessagesChunkwise. Empfänger: " + pRecipientPersonOid + ", Absender: " + pSenderPersonOid + ". Ist ein Team: " + (pIsForTeam ? "ja" : "nein" + ". Ausnahmen: " + (pExceptions ?? "KEINE AUSNAHMEN") + ". Älteste Nachricht auf dem Mobilgerät: " + (messageId ?? "KEINE NACHRICHT AUF DEM MOBILGERÄT") + "."));
|
||||||
|
|
||||||
var exceptions = new List<string>();
|
var exceptions = new List<string>();
|
||||||
|
|
||||||
if (pExceptions.Length > 0)
|
if (pExceptions.Length > 0)
|
||||||
@@ -217,7 +231,7 @@ namespace BeWoPlanerAndroid
|
|||||||
|
|
||||||
var jsonMessages = new List<ChatMessageForJson>();
|
var jsonMessages = new List<ChatMessageForJson>();
|
||||||
|
|
||||||
var liste = DAOFactory.SearchDAO.LoadChatMessagesChunkwise(messageId, pRecipientPersonOid, pSenderPersonOid, pIsForTeam, exceptions).DoForEach(dfe => jsonMessages.Add(new ChatMessageForJson(dfe.EmpfaengerPersonOid, dfe.SenderPersonOid, dfe.IsDelivered, dfe.IstGelesen, dfe.TeamOid, dfe.ChatText, dfe.Uhrzeit, dfe.Oid, dfe.InsTs, dfe.MessageId)));
|
var liste = DAOFactory.SearchDAO.LoadChatMessagesChunkwise(messageId, pRecipientPersonOid, pSenderPersonOid, pIsForTeam, exceptions, pIsInitialCall).DoForEach(dfe => jsonMessages.Add(new ChatMessageForJson(dfe.EmpfaengerPersonOid, dfe.SenderPersonOid, dfe.IsDelivered, dfe.IstGelesen, dfe.TeamOid, dfe.ChatText, dfe.Uhrzeit, dfe.Oid, dfe.InsTs, dfe.MessageId)));
|
||||||
|
|
||||||
return JsonConvert.SerializeObject(jsonMessages);
|
return JsonConvert.SerializeObject(jsonMessages);
|
||||||
}
|
}
|
||||||
@@ -280,7 +294,9 @@ namespace BeWoPlanerAndroid
|
|||||||
|
|
||||||
public bool IsEmployee { get; set; }
|
public bool IsEmployee { get; set; }
|
||||||
|
|
||||||
public ChatPerson(long pOid, string pName, bool pIsTeam, string pTeamMemberOids, string pTeamMemberNames, long pVersion, bool pIsEmployee)
|
public string PhoneNumber { get; set; }
|
||||||
|
|
||||||
|
public ChatPerson(long pOid, string pName, bool pIsTeam, string pTeamMemberOids, string pTeamMemberNames, long pVersion, bool pIsEmployee, string pPhoneNumber)
|
||||||
{
|
{
|
||||||
Oid = pOid;
|
Oid = pOid;
|
||||||
Name = pName;
|
Name = pName;
|
||||||
@@ -289,6 +305,7 @@ namespace BeWoPlanerAndroid
|
|||||||
TeamMemberNames = pTeamMemberNames;
|
TeamMemberNames = pTeamMemberNames;
|
||||||
Version = pVersion;
|
Version = pVersion;
|
||||||
IsEmployee = pIsEmployee;
|
IsEmployee = pIsEmployee;
|
||||||
|
PhoneNumber = pPhoneNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,3 +33,5 @@ using System.Runtime.InteropServices;
|
|||||||
// übernehmen, indem Sie "*" wie folgt verwenden:
|
// übernehmen, indem Sie "*" wie folgt verwenden:
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|
||||||
|
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<system.diagnostics>
|
<system.diagnostics>
|
||||||
<sources>
|
<sources>
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
</source>
|
</source>
|
||||||
</sources>
|
</sources>
|
||||||
</system.diagnostics>
|
</system.diagnostics>
|
||||||
<log4net debug="true">
|
<log4net>
|
||||||
<appender name="logFile" type="log4net.Appender.RollingFileAppender,log4net">
|
<appender name="logFile" type="log4net.Appender.RollingFileAppender,log4net">
|
||||||
<param name="File" value="logs\mobilelog.txt" />
|
<param name="File" value="logs\android_soap_calls.txt" />
|
||||||
<param name="AppendToFile" value="true" />
|
<param name="AppendToFile" value="true" />
|
||||||
<param name="RollingStyle" value="Date" />
|
<param name="RollingStyle" value="Date" />
|
||||||
<param name="DatePattern" value="dd.MM.yyyy" />
|
<param name="DatePattern" value="dd.MM.yyyy" />
|
||||||
|
|||||||
@@ -1809,6 +1809,8 @@ namespace BeWo.Data.Access
|
|||||||
|
|
||||||
.SetProjection(Projections.Property("ChatMessageOid"))));
|
.SetProjection(Projections.Property("ChatMessageOid"))));
|
||||||
|
|
||||||
|
var query = ToSql(c);
|
||||||
|
|
||||||
return c.List<ChatMessage>();
|
return c.List<ChatMessage>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1838,7 +1840,7 @@ namespace BeWo.Data.Access
|
|||||||
return liste.Select(s => s.MessageId);
|
return liste.Select(s => s.MessageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<ChatMessage> LoadChatMessagesChunkwise(string pMessageId, long pRecipientOid, long pSenderOid, bool pForTeam, List<string> pExceptions)
|
public IEnumerable<ChatMessage> LoadChatMessagesChunkwise(string pMessageId, long pRecipientOid, long pSenderOid, bool pForTeam, List<string> pExceptions, bool pIsInitialCall)
|
||||||
{
|
{
|
||||||
var c = CreateCriteriaIsActive<ChatMessage>()
|
var c = CreateCriteriaIsActive<ChatMessage>()
|
||||||
.Add(Restrictions.Or(
|
.Add(Restrictions.Or(
|
||||||
@@ -1866,19 +1868,25 @@ namespace BeWo.Data.Access
|
|||||||
var list = c1.List<ChatMessage>();
|
var list = c1.List<ChatMessage>();
|
||||||
if (list.Count > 0)
|
if (list.Count > 0)
|
||||||
{
|
{
|
||||||
var lastLoadedChatMessage = c1.List<ChatMessage>().First(); // Was ist bei einer leeren Liste?
|
var lastLoadedChatMessage = c1.List<ChatMessage>().First();
|
||||||
|
|
||||||
c.Add(Restrictions.Not(Restrictions.In(ChatMessage.PropertyName_MessageId, pExceptions)));
|
c.Add(Restrictions.Not(Restrictions.In(ChatMessage.PropertyName_MessageId, pExceptions)));
|
||||||
c.Add(Restrictions.Lt(BeWoEntityBase.PropertyName_InsTs, lastLoadedChatMessage.InsTs));
|
|
||||||
|
if (pIsInitialCall)
|
||||||
|
{
|
||||||
|
c.Add(Restrictions.Gt(BeWoEntityBase.PropertyName_InsTs, lastLoadedChatMessage.InsTs));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.AddOrder(Order.Desc(BeWoEntityBase.PropertyName_InsTs));
|
c.AddOrder(Order.Desc(BeWoEntityBase.PropertyName_InsTs));
|
||||||
c.SetMaxResults(50);
|
c.SetMaxResults(50);
|
||||||
|
|
||||||
var sql = ToSql(c);
|
var sqlQeury = ToSql(c);
|
||||||
|
|
||||||
return c.List<ChatMessage>();
|
var result = c.List<ChatMessage>();
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IList<ChatMediaMessage> GetChatMediaMessagesForChatMessage(long chatMessageOid)
|
public IList<ChatMediaMessage> GetChatMediaMessagesForChatMessage(long chatMessageOid)
|
||||||
@@ -1907,7 +1915,7 @@ namespace BeWo.Data.Access
|
|||||||
if (pIsTeam)
|
if (pIsTeam)
|
||||||
{
|
{
|
||||||
c.Add(Restrictions.And(Restrictions.Eq(NewestChatMessage.PropertyName_IsTeam, true),
|
c.Add(Restrictions.And(Restrictions.Eq(NewestChatMessage.PropertyName_IsTeam, true),
|
||||||
Restrictions.In(NewestChatMessage.PropertyName_RecipientPersonOid, teams.ToArray())));
|
Restrictions.Eq(NewestChatMessage.PropertyName_RecipientPersonOid, pRecipientPersonOid)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||