use of com.lingtuan.firefly.vo.ChatMsg in project SmartMesh_Android by SmartMeshFoundation.
the class XmppMessageUtil method sendAudio.
/**
* Send a voice message
*/
public ChatMsg sendAudio(String uid, String content, String uName, String avatarUrl, String second, boolean isGroup, boolean isSend) {
ChatMsg chatMsg = new ChatMsg();
chatMsg.setType(2);
final String body = chatMsg.getContent();
chatMsg.setContent(content);
chatMsg.setSecond(second);
chatMsg = send(uid, uName, avatarUrl, chatMsg, false, isGroup, isSend);
// Using a local url
chatMsg.setContent(body);
return chatMsg;
}
use of com.lingtuan.firefly.vo.ChatMsg in project SmartMesh_Android by SmartMeshFoundation.
the class XmppMessageUtil method sendShare.
/**
* Send to share
*/
public ChatMsg sendShare(String uid, String uName, String avatarUrl, String shareUrl, String shareTitle, String shareContent, String shareThumb, boolean isGroup, boolean isSend) {
ChatMsg chatMsg = new ChatMsg();
chatMsg.setType(103);
chatMsg.setContent(shareContent);
chatMsg.setShareUrl(shareUrl);
chatMsg.setShareTitle(shareTitle);
chatMsg.setShareThumb(shareThumb);
return send(uid, uName, avatarUrl, chatMsg, true, isGroup, isSend);
}
use of com.lingtuan.firefly.vo.ChatMsg in project SmartMesh_Android by SmartMeshFoundation.
the class XmppMessageUtil method sendCard.
/**
* Send business card information
*/
public ChatMsg sendCard(String uid, String uName, String avatarUrl, String cardName, String cardSign, String cardImage, String cardId, boolean isGroup, boolean isSend) {
ChatMsg chatMsg = new ChatMsg();
chatMsg.setType(6);
chatMsg.setThirdId(cardId);
chatMsg.setThirdImage(cardImage);
chatMsg.setThirdName(cardName);
chatMsg.setCardSign(cardSign);
return send(uid, uName, avatarUrl, chatMsg, true, isGroup, isSend);
}
use of com.lingtuan.firefly.vo.ChatMsg in project SmartMesh_Android by SmartMeshFoundation.
the class ContactSelectedUI method onItemClick.
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position == 0) {
return;
}
final ChatMsg msg = mAdapter.getItem(position - 1);
// if(cantTrans(msg.getChatId())){
// return;
// }
List<UserBaseVo> members = msg.getMemberAvatarUserBaseList();
if (members == null || members.size() == 0) {
members = new ArrayList<>();
UserBaseVo vo = new UserBaseVo();
vo.setGender(msg.getGender() + "");
vo.setThumb(msg.getUserImage());
vo.setUsername(msg.getUsername());
members.add(vo);
}
showDialogFormat(msg.getChatId(), msg.getUsername(), msg.getUserImage(), msg.getGender() + "", msg.isGroup(), members);
}
use of com.lingtuan.firefly.vo.ChatMsg in project SmartMesh_Android by SmartMeshFoundation.
the class ContactSelectedUI method showDialogFormat.
/**
* Forwarding operation box
*/
private void showDialogFormat(final String chatId, final String username, final String avatarUrl, final String gender, final boolean isNewGroup, List<UserBaseVo> members) {
MyViewDialogFragment mdf = new MyViewDialogFragment(MyViewDialogFragment.DIALOG_FORWOED, chatId, getString(R.string.chat_send_to), username, linkTitle, members);
FragmentManager manager = getSupportFragmentManager();
mdf.setLeaveMsgCallBack(new MyViewDialogFragment.LeaveMsgCallBack() {
@Override
public void leaveMsgMethod(String content) {
if (msgList != null && msgList.size() > 0) {
if (!TextUtils.isEmpty(content)) {
ChatMsg chatmsg = new ChatMsg();
chatmsg.setType(0);
chatmsg.setContent(content);
chatmsg.setCreateTime(System.currentTimeMillis() / 1000);
chatmsg.parseUserBaseVo(NextApplication.myInfo);
msgList.add(chatmsg);
}
new SendMsgThread(ContactSelectedUI.this, msgList, chatId, username, avatarUrl, gender, false, false, isNewGroup);
}
}
});
if (manager != null && !isFinishing()) {
try {
mdf.show(manager, "mdf");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Aggregations