Skip to content

Commit

Permalink
upgrade to v4.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ericliang committed Jul 8, 2023
1 parent 62bbad3 commit f56db58
Show file tree
Hide file tree
Showing 23 changed files with 1,457 additions and 156 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# floo-android Changelog
[蓝莺IM](https://www.lanyingim.com/),是由美信拓扑团队研发的新一代即时通讯云服务,SDK设计简单集成方便,服务采用云原生技术和多云架构,私有云也可按月付费。

## 4.0.3 - 2023/07/07
新增:
1. 音视频通话离线推送消息支持多语言。

## 4.0.2 - 2023/06/21
优化:
1. 音视频通话功能升级。

## 3.6.0 - 2022/12/20
解决bug:
1. 在安卓低于6.0版本系统下,发送和接收Emoji表情字符时崩溃。
Expand Down
4 changes: 2 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ add_library( # Sets the name of the library.
floo/src/protocol/bmx_xsync_parser.cc
floo/src/protocol/bmx_conversation_unread.cc
floo/src/protocol/bmx_zlib_compression.cc
floo/src/protocol/bmx_rtc_message.cc
floo/src/protocol/bmx_rtc_signal.cc
floo/src/protocol/generated/groupnotice.pb.cc
floo/src/protocol/generated/info.pb.cc
floo/src/protocol/generated/messagebody.pb.cc
Expand All @@ -110,7 +110,7 @@ add_library( # Sets the name of the library.
floo/src/protocol/generated/xid.pb.cc
floo/src/protocol/generated/xsync.pb.cc
floo/src/protocol/generated/conversation.pb.cc
floo/src/protocol/generated/rtc_message.pb.cc
floo/src/protocol/generated/rtcsignal.pb.cc
floo/deps/protobuf/google/protobuf/any.cc
floo/deps/protobuf/google/protobuf/any.pb.cc
floo/deps/protobuf/google/protobuf/api.pb.cc
Expand Down
16 changes: 12 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 27
compileSdkVersion 29
defaultConfig {
targetSdkVersion 27
versionCode 1
versionName "3.6.0.20221220"
targetSdkVersion 29
versionCode 3
versionName "4.0.3.20230707"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
minSdkVersion 21
}
Expand All @@ -16,10 +16,18 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
ndkVersion '21.4.7075529'

}

dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'org.webrtc:google-webrtc:1.0.30039'

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
Expand Down
8 changes: 4 additions & 4 deletions app/resultpage_rep.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
m2 = re.match(r'(.*arg.[ ]*= \*\()(floo::BMXResultPage\< .*) (\*\*.*)',str(line))
m3 = re.match(r'(.*result[ ]*=[ ]*.*)\(floo::BMXResultPage<.*\*\)(arg.\))(.*;)',str(line))
if m1 and new_delete_block == 0:
print m1.group(1) + "std::shared_ptr< " + m1.group(2) + ">" + m1.group(3) + " = 0 ;"
print(m1.group(1) + "std::shared_ptr< " + m1.group(2) + ">" + m1.group(3) + " = 0 ;")
elif m2 and new_delete_block == 0:
print m2.group(1) + "std::shared_ptr< " + m2.group(2) + ">" + m2.group(3)
print(m2.group(1) + "std::shared_ptr< " + m2.group(2) + ">" + m2.group(3))
elif m3 and new_delete_block == 0:
print m3.group(1) + m3.group(2) + "->get()" + m3.group(3)
print(m3.group(1) + m3.group(2) + "->get()" + m3.group(3))
else :
print line,
print(line, end='')
1,112 changes: 1,010 additions & 102 deletions app/src/main/cpp/floo_wrap.cxx

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions app/src/main/cpp/floo_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,16 @@ class SwigDirector_BMXRTCServiceListener : public floo::BMXRTCServiceListener, p
void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global);
SwigDirector_BMXRTCServiceListener(JNIEnv *jenv);
virtual ~SwigDirector_BMXRTCServiceListener();
virtual void onRTCNoticeStatusChanged(floo::BMXMessagePtr msg, floo::BMXErrorCode error);
virtual void onRTCNoticeReceive(floo::BMXMessageList const &list);
virtual void onRTCMessageStatusChanged(floo::BMXMessagePtr msg, floo::BMXErrorCode error);
virtual void onRTCCallMessageReceive(floo::BMXMessagePtr msg);
virtual void onRTCPickupMessageReceive(floo::BMXMessagePtr msg);
virtual void onRTCHangupMessageReceive(floo::BMXMessagePtr msg);
public:
bool swig_overrides(int n) {
return (n < 2 ? swig_override[n] : false);
return (n < 4 ? swig_override[n] : false);
}
protected:
Swig::BoolArray<2> swig_override;
Swig::BoolArray<4> swig_override;
};

class SwigDirector_BMXRosterServiceListener : public floo::BMXRosterServiceListener, public Swig::Director {
Expand Down Expand Up @@ -253,12 +255,13 @@ class SwigDirector_BMXUserServiceListener : public floo::BMXUserServiceListener,
virtual void onInfoUpdated(floo::BMXUserProfilePtr profile);
virtual void onOtherDeviceSingIn(int deviceSN);
virtual void onOtherDeviceSingOut(int deviceSN);
virtual void onTrafficLimitExceeded();
public:
bool swig_overrides(int n) {
return (n < 6 ? swig_override[n] : false);
return (n < 7 ? swig_override[n] : false);
}
protected:
Swig::BoolArray<6> swig_override;
Swig::BoolArray<7> swig_override;
};

class SwigDirector_BMXGroupServiceListener : public floo::BMXGroupServiceListener, public Swig::Director {
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/im/floo/floolib/BMXClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ public BMXErrorCode signOut() {
return BMXErrorCode.swigToEnum(flooJNI.BMXClient_signOut__SWIG_2(swigCPtr, this));
}

/**
* 删除当前账号及其所有数据
* @param password 当前账号的登录密码
* @return BMXErrorCode
**/
public BMXErrorCode deleteAccount(String password) {
return BMXErrorCode.swigToEnum(flooJNI.BMXClient_deleteAccount(swigCPtr, this, password));
}

/**
* 获取当前和服务器的连接状态
* @return BMXConnectStatus
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/im/floo/floolib/BMXConversation.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ private BMXErrorCode updateMessageExtension(BMXMessage msg) {
/**
* 插入一条消息
* @param msg 插入的消息
* @param isHistory 历史消息
* @return BMXErrorCode
**/
private BMXErrorCode insertMessage(BMXMessage msg) {
return BMXErrorCode.swigToEnum(flooJNI.BMXConversation_insertMessage(swigCPtr, this, BMXMessage.getCPtr(msg), msg));
public BMXErrorCode insertMessage(BMXMessage msg, boolean isHistory) {
return BMXErrorCode.swigToEnum(flooJNI.BMXConversation_insertMessage__SWIG_0(swigCPtr, this, BMXMessage.getCPtr(msg), msg, isHistory));
}

/**
Expand Down Expand Up @@ -471,11 +472,11 @@ public void onPostExecute(BMXErrorCode code) {
* @param msg 插入的消息
* @param callBack 回调
**/
public void insertMessage(final BMXMessage msg,final BMXCallBack callBack) {
public void insertMessage(final BMXMessage msg, final boolean isHistory, final BMXCallBack callBack) {
new AsyncExecutor().exec(new AsyncExecutor.Task() {
@Override
public BMXErrorCode exec() {
return insertMessage(msg);
return insertMessage(msg, isHistory);
}

@Override
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/java/im/floo/floolib/BMXErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public enum BMXErrorCode {
UserAbnormal,
UserCancel,
UserOldPasswordNotMatch,
UserSigningIn,
PushTokenInvalid(200),
PushAliasBindByOtherUser,
PushAliasTokenNotMatch,
Expand All @@ -53,9 +54,12 @@ public enum BMXErrorCode {
MessageRecallDisabled,
MessageCensored,
MessageInvalidType,
MessageBadArg,
MessageRateLimitExceeded,
RosterNotFriend(500),
RosterBlockListExist,
RosterRejectApplication,
RosterHasDeletedFromSystem,
GroupServerDbError(600),
GroupNotExist,
GroupNotMemberFound,
Expand Down Expand Up @@ -110,7 +114,10 @@ public enum BMXErrorCode {
ServerAppNotifierNotExist,
ServerNoClusterInfoForClusterId,
ServerFileDownloadFailure,
ServerAppStatusNotNormal;
ServerAppStatusNotNormal,
ServerPlatformNotAllowed,
ServerCannotCreateDeviceSn,
ServerRtcNotOpen;

public final int swigValue() {
return swigValue;
Expand Down
32 changes: 31 additions & 1 deletion app/src/main/java/im/floo/floolib/BMXMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,19 @@ public static BMXMessage createCommandMessage(long from, long to, BMXMessage.Mes
return (cPtr == 0) ? null : new BMXMessage(cPtr, true);
}

/**
* 创建RTC的消息
* @param from 消息发送者
* @param to 消息接收者
* @param type 消息类型
* @param conversationId 会话id
* @param content 消息内容
**/
public static BMXMessage createRTCMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content) {
long cPtr = flooJNI.BMXMessage_createRTCMessage__SWIG_0(from, to, type.swigValue(), conversationId, content);
return (cPtr == 0) ? null : new BMXMessage(cPtr, true);
}

/**
* 创建收到的消息
* @param msgId 消息id
Expand All @@ -445,6 +458,22 @@ public static BMXMessage createMessage(long msgId, long from, long to, BMXMessag
return (cPtr == 0) ? null : new BMXMessage(cPtr, true);
}


/**
* 创建收到的RTC消息
* @param msgId 消息id
* @param from 消息发送者
* @param to 消息接收者
* @param type 消息类型
* @param conversationId 会话id
* @param content 消息内容
* @param serverTimestamp 服务器时间戳
**/
public static BMXMessage createRTCMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp) {
long cPtr = flooJNI.BMXMessage_createRTCMessage__SWIG_1(msgId, from, to, type.swigValue(), conversationId, content, serverTimestamp);
return (cPtr == 0) ? null : new BMXMessage(cPtr, true);
}

/**
* 创建收到的消息
* @param msgId 消息id
Expand Down Expand Up @@ -593,7 +622,8 @@ public enum ContentType {
File,
Location,
Command,
Forward;
Forward,
RTC;

public final int swigValue() {
return swigValue;
Expand Down
Loading

0 comments on commit f56db58

Please sign in to comment.