Skip to content

Commit 6650a8d

Browse files
committed
Merge branch 'master' into msglst
2 parents f1efd02 + 3f196fc commit 6650a8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+27459
-25800
lines changed

ChangeLog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Default Qt Client
1313
- Option to choose bitween text or emoji for user and channel info in channel list
1414
- Last login time shown in "User Accounts" dialog
1515
- Ability to sort by "Last Login Time" in "User Accounts" dialog
16+
- Ability to send toast notifications on Linux and Windows
1617
- Chat history replaced by list
1718
- WebRTC updated from r4332 to r6818
1819
- Qt updated to 6.9.0beta3 on macOS and Windows
@@ -21,6 +22,8 @@ Default Qt Client
2122
- Fixed language not set at first start
2223
- Fixed OPUS DTX mode sending too big packets when variable bitrate mode (VBR) was disabled
2324
Android Client
25+
- Broadcast messages are now shown in the chat tab
26+
- Added the ability to send broadcast messages
2427
- Redesigned server list dialog to remove the old remove server button and make it to use popup menus, results in a more clear and modern dialog, and fast navigating for screenreader users
2528
- IP Address and status message is now shown in User Properties dialog
2629
- Ability to select/deselect user for move to other channel

Client/TeamTalkAndroid/src/main/java/dk/bearware/backend/TeamTalkService.java

+4
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,10 @@ public void onCmdUserTextMessage(TextMessage textmessage) {
10651065
getUserTextMsgs(textmessage.nFromUserID).add(newmsg);
10661066
break;
10671067
}
1068+
case TextMsgType.MSGTYPE_BROADCAST : {
1069+
getChatLogTextMsgs().add(newmsg);
1070+
break;
1071+
}
10681072
case TextMsgType.MSGTYPE_CHANNEL : {
10691073
getChatLogTextMsgs().add(newmsg);
10701074
break;

Client/TeamTalkAndroid/src/main/java/dk/bearware/data/TextMessageAdapter.java

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
149149

150150
switch(txtmsg.nMsgType) {
151151
case TextMsgType.MSGTYPE_CHANNEL :
152+
case TextMsgType.MSGTYPE_BROADCAST :
152153
case TextMsgType.MSGTYPE_USER : {
153154
if(convertView == null ||
154155
convertView.findViewById(R.id.item_textmsg) == null)

Client/TeamTalkAndroid/src/main/java/dk/bearware/gui/MainActivity.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,21 @@ public boolean onPrepareOptionsMenu(Menu menu) {
297297
}
298298

299299
boolean uploadRight = (myuseraccount.uUserRights & UserRight.USERRIGHT_UPLOAD_FILES) != UserRight.USERRIGHT_NONE;
300+
boolean broadcastRight = (myuseraccount.uUserRights & UserRight.USERRIGHT_TEXTMESSAGE_BROADCAST) != UserRight.USERRIGHT_NONE;
300301
boolean isEditable = curchannel != null;
301302
boolean isJoinable = (ttclient != null) && (curchannel != null) && (ttclient.getMyChannelID() != curchannel.nChannelID) && (curchannel.nMaxUsers > 0);
302303
boolean isMyChannel = (ttclient != null) && (curchannel != null) && (ttclient.getMyChannelID() == curchannel.nChannelID);
303304
menu.findItem(R.id.action_edit).setEnabled(isEditable).setVisible(isEditable);
304305
menu.findItem(R.id.action_join).setEnabled(isJoinable).setVisible(isJoinable);
305306
menu.findItem(R.id.action_upload).setEnabled(uploadRight).setVisible(uploadRight);
307+
menu.findItem(R.id.action_broadcast).setEnabled(broadcastRight).setVisible(broadcastRight);
306308
menu.findItem(R.id.action_stream).setEnabled(isMyChannel).setVisible(isMyChannel);
307309
return super.onPrepareOptionsMenu(menu);
308310
}
309311

310312
@Override
311313
public boolean onOptionsItemSelected(MenuItem item) {
314+
AlertDialog.Builder alert = new AlertDialog.Builder(this);
312315
switch(item.getItemId()) {
313316
case R.id.action_join : {
314317
if (curchannel != null)
@@ -323,6 +326,16 @@ public boolean onOptionsItemSelected(MenuItem item) {
323326
}
324327
}
325328
break;
329+
case R.id.action_broadcast:
330+
alert.setTitle(R.string.action_broadcast);
331+
alert.setMessage(R.string.text_broadcast_message);
332+
final EditText input = new EditText(this);
333+
input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
334+
alert.setPositiveButton(android.R.string.yes, (dialog, whichButton) -> ttclient.doTextMessage(new TextMessage() {{ nMsgType = TextMsgType.MSGTYPE_BROADCAST; szMessage = input.getText().toString(); }}));
335+
alert.setNegativeButton(android.R.string.no, null);
336+
alert.setView(input);
337+
alert.show();
338+
break;
326339
case R.id.action_stream : {
327340
int flags = ttclient.getFlags();
328341
if ((flags & ClientFlag.CLIENT_STREAM_AUDIO) == ClientFlag.CLIENT_STREAM_AUDIO || (flags & ClientFlag.CLIENT_STREAM_VIDEO) == ClientFlag.CLIENT_STREAM_VIDEO) {
@@ -369,7 +382,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
369382
channelsAdapter.notifyDataSetChanged();
370383
}
371384
else if (filesAdapter.getActiveTransfersCount() > 0) {
372-
AlertDialog.Builder alert = new AlertDialog.Builder(this);
373385
alert.setMessage(R.string.disconnect_alert);
374386
alert.setPositiveButton(android.R.string.ok, (dialog, whichButton) -> {
375387
filesAdapter.cancelAllTransfers();
@@ -2171,6 +2183,7 @@ else if (textmessage.nFromUserID == ttservice.getTTInstance().getMyUserID()) {
21712183
String name = Utils.getDisplayName(getBaseContext(), sender);
21722184
ttsWrapper.speak(getString(R.string.text_tts_broadcast_message, (sender != null) ? name : "", textmessage.szMessage));
21732185
}
2186+
Log.d(TAG, "Broadcast message in " + this.hashCode());
21742187
break;
21752188
case TextMsgType.MSGTYPE_USER :
21762189
if (sounds.get(SOUND_USERMSG) != 0)

Client/TeamTalkAndroid/src/main/res/menu/main.xml

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
android:id="@+id/action_upload"
1717
app:showAsAction="ifRoom|withText"
1818
android:title="@string/action_upload"/>
19+
<item
20+
android:id="@+id/action_broadcast"
21+
app:showAsAction="ifRoom|withText"
22+
android:title="@string/action_broadcast"/>
1923
<item
2024
android:id="@+id/action_stream"
2125
app:showAsAction="ifRoom|withText"

Client/TeamTalkAndroid/src/main/res/values-fr/strings.xml

+2
Original file line numberDiff line numberDiff line change
@@ -395,5 +395,7 @@
395395
<string name="text_operator_password">Entrer le mot de passe de l\'opérateur du canal</string>
396396
<string name="action_editsrv">Éditer le serveur</string>
397397
<string name="action_removesrv">Supprimer le serveur</string>
398+
<string name="action_broadcast">Message Diffusé</string>
399+
<string name="text_broadcast_message">Entrer le message à diffuser</string>
398400

399401
</resources>

Client/TeamTalkAndroid/src/main/res/values/strings.xml

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
<string name="action_editsrv">Edit server</string>
151151
<string name="action_removesrv">Remove server</string>
152152
<string name="action_upload">Upload File</string>
153+
<string name="action_broadcast">Broadcast Message</string>
153154
<string name="action_stream">Stream a media file</string>
154155
<string name="button_select_media_file">Browse</string>
155156
<string name="button_stream_media_file">Stream</string>
@@ -406,6 +407,7 @@
406407
<string name="action_make_operator">Grant Operator</string>
407408
<string name="action_revoke_operator">Revoke Operator</string>
408409
<string name="text_operator_password">Enter channel operator password</string>
410+
<string name="text_broadcast_message">Enter broadcast message</string>
409411

410412

411413
</resources>

0 commit comments

Comments
 (0)