@droppii-org/chat-mobile 0.2.72 → 0.2.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,11 @@
3
3
  import OpenIMSDK from '@droppii/openim-rn-client-sdk';
4
4
  import { useQueryClient } from '@tanstack/react-query';
5
5
  import { useMutation } from '@tanstack/react-query';
6
+ import { DeviceEventEmitter } from 'react-native';
6
7
  import { conversationQueryKeys, groupQueryKeys } from "../query-keys.js";
7
8
  import { UIUtils } from "../../utils/UIUtils.js";
8
9
  import { trans } from "../../translation/index.js";
10
+ import { ChatEvent } from "../../types/events.js";
9
11
  export const useJoinGroup = () => {
10
12
  const queryClient = useQueryClient();
11
13
  return useMutation({
@@ -36,6 +38,11 @@ export const useJoinGroup = () => {
36
38
  groupName: params?.groupName || ''
37
39
  })
38
40
  });
41
+ OpenIMSDK.getSelfUserInfo(params.groupID).then(info => {
42
+ DeviceEventEmitter.emit(ChatEvent.GroupPermissionUpdated, {
43
+ permissions: info?.permissions ?? []
44
+ });
45
+ }).catch(() => {});
39
46
  }
40
47
  });
41
48
  };
@@ -1 +1 @@
1
- {"version":3,"names":["OpenIMSDK","useQueryClient","useMutation","conversationQueryKeys","groupQueryKeys","UIUtils","trans","useJoinGroup","queryClient","mutationKey","join","mutationFn","params","joinGroup","onSuccess","_data","invalidateQueries","queryKey","joinedGroup","groupID","setQueriesData","public","exact","old","pages","map","page","groups","g","isJoined","toast","open","title","groupName"],"sourceRoot":"../../../../src","sources":["hooks/groups/useJoinGroup.ts"],"mappings":";;AAAA,OAAOA,SAAS,MAAgC,+BAA+B;AAC/E,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,qBAAqB,EAAEC,cAAc,QAAQ,kBAAe;AACrE,SAASC,OAAO,QAAQ,wBAAqB;AAC7C,SAASC,KAAK,QAAQ,4BAAmB;AAEzC,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAChC,MAAMC,WAAW,GAAGP,cAAc,CAAC,CAAC;EAEpC,OAAOC,WAAW,CAAC;IACjBO,WAAW,EAAEL,cAAc,CAACM,IAAI,CAAC,CAAC;IAClCC,UAAU,EAAGC,MAA+C,IAC1DZ,SAAS,CAACa,SAAS,CAACD,MAAM,CAAC;IAC7BE,SAAS,EAAEA,CAACC,KAAK,EAAEH,MAAM,KAAK;MAC5BJ,WAAW,CAACQ,iBAAiB,CAAC;QAC5BC,QAAQ,EAAEd,qBAAqB,CAACe,WAAW,CAACN,MAAM,CAACO,OAAO;MAC5D,CAAC,CAAC;MAEFX,WAAW,CAACY,cAAc,CAMvB;QAAEH,QAAQ,EAAEb,cAAc,CAACiB,MAAM,CAAC,CAAC;QAAEC,KAAK,EAAE;MAAM,CAAC,EAAGC,GAAG,IAAK;QAC/D,IAAI,CAACA,GAAG,EAAE,OAAOA,GAAG;QACpB,OAAO;UACL,GAAGA,GAAG;UACNC,KAAK,EAAED,GAAG,CAACC,KAAK,CAACC,GAAG,CAAEC,IAAI,KAAM;YAC9B,GAAGA,IAAI;YACPC,MAAM,EAAED,IAAI,CAACC,MAAM,CAACF,GAAG,CAAEG,CAAC,IACxBA,CAAC,CAACT,OAAO,KAAKP,MAAM,CAACO,OAAO,GAAG;cAAE,GAAGS,CAAC;cAAEC,QAAQ,EAAE;YAAK,CAAC,GAAGD,CAC5D;UACF,CAAC,CAAC;QACJ,CAAC;MACH,CAAC,CAAC;MAEFvB,OAAO,CAACyB,KAAK,CAACC,IAAI,CAAC;QACjBC,KAAK,EAAE1B,KAAK,CAAC,oBAAoB,EAAE;UACjC2B,SAAS,EAAErB,MAAM,EAAEqB,SAAS,IAAI;QAClC,CAAC;MACH,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["OpenIMSDK","useQueryClient","useMutation","DeviceEventEmitter","conversationQueryKeys","groupQueryKeys","UIUtils","trans","ChatEvent","useJoinGroup","queryClient","mutationKey","join","mutationFn","params","joinGroup","onSuccess","_data","invalidateQueries","queryKey","joinedGroup","groupID","setQueriesData","public","exact","old","pages","map","page","groups","g","isJoined","toast","open","title","groupName","getSelfUserInfo","then","info","emit","GroupPermissionUpdated","permissions","catch"],"sourceRoot":"../../../../src","sources":["hooks/groups/useJoinGroup.ts"],"mappings":";;AAAA,OAAOA,SAAS,MAAgC,+BAA+B;AAC/E,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,qBAAqB,EAAEC,cAAc,QAAQ,kBAAe;AACrE,SAASC,OAAO,QAAQ,wBAAqB;AAC7C,SAASC,KAAK,QAAQ,4BAAmB;AACzC,SAASC,SAAS,QAAQ,uBAAoB;AAE9C,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAChC,MAAMC,WAAW,GAAGT,cAAc,CAAC,CAAC;EAEpC,OAAOC,WAAW,CAAC;IACjBS,WAAW,EAAEN,cAAc,CAACO,IAAI,CAAC,CAAC;IAClCC,UAAU,EAAGC,MAA+C,IAC1Dd,SAAS,CAACe,SAAS,CAACD,MAAM,CAAC;IAC7BE,SAAS,EAAEA,CAACC,KAAK,EAAEH,MAAM,KAAK;MAC5BJ,WAAW,CAACQ,iBAAiB,CAAC;QAC5BC,QAAQ,EAAEf,qBAAqB,CAACgB,WAAW,CAACN,MAAM,CAACO,OAAO;MAC5D,CAAC,CAAC;MAEFX,WAAW,CAACY,cAAc,CAMvB;QAAEH,QAAQ,EAAEd,cAAc,CAACkB,MAAM,CAAC,CAAC;QAAEC,KAAK,EAAE;MAAM,CAAC,EAAGC,GAAG,IAAK;QAC/D,IAAI,CAACA,GAAG,EAAE,OAAOA,GAAG;QACpB,OAAO;UACL,GAAGA,GAAG;UACNC,KAAK,EAAED,GAAG,CAACC,KAAK,CAACC,GAAG,CAAEC,IAAI,KAAM;YAC9B,GAAGA,IAAI;YACPC,MAAM,EAAED,IAAI,CAACC,MAAM,CAACF,GAAG,CAAEG,CAAC,IACxBA,CAAC,CAACT,OAAO,KAAKP,MAAM,CAACO,OAAO,GAAG;cAAE,GAAGS,CAAC;cAAEC,QAAQ,EAAE;YAAK,CAAC,GAAGD,CAC5D;UACF,CAAC,CAAC;QACJ,CAAC;MACH,CAAC,CAAC;MAEFxB,OAAO,CAAC0B,KAAK,CAACC,IAAI,CAAC;QACjBC,KAAK,EAAE3B,KAAK,CAAC,oBAAoB,EAAE;UACjC4B,SAAS,EAAErB,MAAM,EAAEqB,SAAS,IAAI;QAClC,CAAC;MACH,CAAC,CAAC;MAEFnC,SAAS,CAACoC,eAAe,CAACtB,MAAM,CAACO,OAAO,CAAC,CACtCgB,IAAI,CAAEC,IAAI,IAAK;QACdnC,kBAAkB,CAACoC,IAAI,CAAC/B,SAAS,CAACgC,sBAAsB,EAAE;UACxDC,WAAW,EAAEH,IAAI,EAAEG,WAAW,IAAI;QACpC,CAAC,CAAC;MACJ,CAAC,CAAC,CACDC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACpB;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useJoinGroup.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useJoinGroup.ts"],"names":[],"mappings":"AAAA,OAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAOhF,eAAO,MAAM,YAAY;eAK+B,MAAM;WAiC7D,CAAC"}
1
+ {"version":3,"file":"useJoinGroup.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useJoinGroup.ts"],"names":[],"mappings":"AAAA,OAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAShF,eAAO,MAAM,YAAY;eAK+B,MAAM;WAyC7D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-mobile",
3
- "version": "0.2.72",
3
+ "version": "0.2.73",
4
4
  "description": "Droppii chat mobile",
5
5
  "keywords": [
6
6
  "react-native",
@@ -69,7 +69,7 @@
69
69
  "example-legacy": "yarn workspace @droppii-org/chat-mobile-example-legacy"
70
70
  },
71
71
  "dependencies": {
72
- "@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-rc27",
72
+ "@droppii/openim-rn-client-sdk": "git+ssh://git@github.com/droppii/open-im-sdk-reactnative.git#v1.0.0-rc28",
73
73
  "@legendapp/list": "^3.0.6",
74
74
  "axios": "^1.16.1",
75
75
  "lodash": "^4.18.1",
@@ -1,9 +1,11 @@
1
1
  import OpenIMSDK, { type JoinGroupParams } from '@droppii/openim-rn-client-sdk';
2
2
  import { useQueryClient } from '@tanstack/react-query';
3
3
  import { useMutation } from '@tanstack/react-query';
4
+ import { DeviceEventEmitter } from 'react-native';
4
5
  import { conversationQueryKeys, groupQueryKeys } from '../query-keys';
5
6
  import { UIUtils } from '../../utils/UIUtils';
6
7
  import { trans } from '../../translation';
8
+ import { ChatEvent } from '../../types/events';
7
9
 
8
10
  export const useJoinGroup = () => {
9
11
  const queryClient = useQueryClient();
@@ -41,6 +43,14 @@ export const useJoinGroup = () => {
41
43
  groupName: params?.groupName || '',
42
44
  }),
43
45
  });
46
+
47
+ OpenIMSDK.getSelfUserInfo(params.groupID)
48
+ .then((info) => {
49
+ DeviceEventEmitter.emit(ChatEvent.GroupPermissionUpdated, {
50
+ permissions: info?.permissions ?? [],
51
+ });
52
+ })
53
+ .catch(() => {});
44
54
  },
45
55
  });
46
56
  };