本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_messages_editMessage方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_messages_editMessage方法的具体用法?Java TLRPC.TL_messages_editMessage怎么用?Java TLRPC.TL_messages_editMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_messages_editMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: editMessage
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public int editMessage(MessageObject messageObject, String message, boolean searchLinks, final BaseFragment fragment, ArrayList<TLRPC.MessageEntity> entities, final Runnable callback) {
if (fragment == null || fragment.getParentActivity() == null || callback == null) {
return 0;
}
TLRPC.TL_messages_editMessage req = new TLRPC.TL_messages_editMessage();
req.peer = MessagesController.getInputPeer((int) messageObject.getDialogId());
req.message = message;
req.flags |= 2048;
req.id = messageObject.getId();
req.no_webpage = !searchLinks;
if (entities != null) {
req.entities = entities;
req.flags |= 8;
}
return ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
callback.run();
}
});
if (error == null) {
MessagesController.getInstance().processUpdates((TLRPC.Updates) response, false);
} else {
if (!error.text.equals("MESSAGE_NOT_MODIFIED")) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setMessage(LocaleController.getString("EditMessageError", R.string.EditMessageError));
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
fragment.showDialog(builder.create());
}
});
}
}
}
});
}